|
-
Mar 18th, 2006, 01:50 PM
#1
Thread Starter
Addicted Member
Rich Textbox URLS
Hey. I just added a website url to my rich textbox and it automatically underlines it. Is there a way that I can make it so if the user clicks on that link within the textbox then it will open up the link? thanks!!
John
-
Mar 18th, 2006, 02:06 PM
#2
Re: Rich Textbox URLS
 Originally Posted by JohnRChick
Hey. I just added a website url to my rich textbox and it automatically underlines it. Is there a way that I can make it so if the user clicks on that link within the textbox then it will open up the link? thanks!!
John
Hi,
I think you cab do it in another way.
Create a LinkLabel in your RTB and name it like your URL.
See this code:
VB Code:
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
TextBox1.Text = "Hello there"
End Sub
Hope it helps,
sparrow1
-
Mar 18th, 2006, 02:10 PM
#3
Thread Starter
Addicted Member
Re: Rich Textbox URLS
hmm but the thing is that then the link away stays where you put it in the text box.. my url is at the bottom so its only visible when the user scrolls down
-
Mar 18th, 2006, 03:11 PM
#4
Re: Rich Textbox URLS
 Originally Posted by JohnRChick
hmm but the thing is that then the link away stays where you put it in the text box.. my url is at the bottom so its only visible when the user scrolls down
I found a link about URL's
http://www.vbforums.com/showthread.p...hlight=url%27s
Hope it's better
sparrow1
-
Mar 18th, 2006, 04:26 PM
#5
Thread Starter
Addicted Member
Re: Rich Textbox URLS
uhh that doesn't really help haha any more ideas
-
Mar 28th, 2006, 10:47 AM
#6
Thread Starter
Addicted Member
-
Mar 28th, 2006, 11:45 AM
#7
Re: Rich Textbox URLS
 Originally Posted by JohnRChick
Hey. I just added a website url to my rich textbox and it automatically underlines it. Is there a way that I can make it so if the user clicks on that link within the textbox then it will open up the link? thanks!!
John
Hi John,
Yes I know It's me again, and again with a few links, but this time you'll find
some explanation about LinkControl;
http://msdn.microsoft.com/library/de...inkControl.asp
http://msdn.microsoft.com/library/de...inkControl.asp
http://msdn.microsoft.com/library/de...inkcontrol.asp
I hope it really helps you this time!
sparrow1
-
Mar 28th, 2006, 05:04 PM
#8
Re: Rich Textbox URLS
The RichTextBox has a LinkClicked event where you would handle what you want to do when a link is clicked.
An example from documentation:
VB Code:
Public p As New System.Diagnostics.Process
Private Sub RichTextBox1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkClickedEventArgs) _
Handles RichTextBox1.LinkClicked
' Call Process.Start method to open a browser
' with link text as URL.
p = System.Diagnostics.Process.Start("IExplore.exe", e.LinkText)
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|