Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 603
  • Last Modified:

richtext url with spaces

I have a richtextbox with detecturl true.

I want to add file link to that richtextbox, this is no problem aslong as the filename or directory name doesn't include spaces

does anybody know if it is possible to do this if the name does include spaces
0
RonaldBiemans
Asked:
RonaldBiemans
  • 2
  • 2
1 Solution
 
arif_eqbalCommented:
Use "%20" in place of Space
0
 
RonaldBiemansAuthor Commented:
That doesn't work, but it gave me an idea on how to make it work, so I'll give you the points
0
 
arif_eqbalCommented:
So what Idea you came up with???
It might Help Others...

0
 
RonaldBiemansAuthor Commented:
Arif_eqbal, You are right. I just replaced the space with another character and then replaced it back when I call the e.linktext, like

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
        OFD1.ShowDialog()
        RichTextBox1.AppendText(OFD1.FileName.Replace(" ", "%"))
    End Sub

Private Sub RichTextBox1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) Handles RichTextBox1.LinkClicked
        System.Diagnostics.Process.Start(e.LinkText.Replace("%", " "))
    End Sub
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now