|
-
Jan 1st, 2012, 07:03 AM
#1
Thread Starter
Hyperactive Member
How to display the anchor text of a link in a label ???!!!!!!! a
I need to display in a label the anchor text of a link, this link is in a website for example:
<a href="url">Link text</a>
I need display in the label the "Link Text" . I only know the url for example :
http://www.adoretube.com , so if the link is :
<a href="http://www.adoretube.com">videos cristianos</a> I need display in the label "videos cristianos" or if the link is :
<a href="http://www.adoretube.com">musica</a> I want to display "musica"
Can you help me?
-
Jan 1st, 2012, 07:23 AM
#2
Re: How to display the anchor text of a link in a label ???!!!!!!! a
Set the LinkLabel Text property to any text you want and in the event LinkClicked use the target url address you want to visit.
vb Code:
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked LinkLabel1.LinkVisited = True System.Diagnostics.Process.Start("C:\Program Files\Internet Explorer\iexplore.exe", "www.msdn.com") End Sub
-
Jan 1st, 2012, 07:34 AM
#3
Thread Starter
Hyperactive Member
Re: How to display the anchor text of a link in a label ???!!!!!!! a
Thanks but I need other thing. I need to extract the anchor text (innertext) and display it in a label.
 Originally Posted by 4x2y
Set the LinkLabel Text property to any text you want and in the event LinkClicked use the target url address you want to visit.
vb Code:
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
LinkLabel1.LinkVisited = True
System.Diagnostics.Process.Start("C:\Program Files\Internet Explorer\iexplore.exe", "www.msdn.com")
End Sub
-
Jan 1st, 2012, 07:46 AM
#4
Re: How to display the anchor text of a link in a label ???!!!!!!! a
Ah... Sorry, misunderstood
Try this function
vb Code:
Private Function GetAnchor(ByVal strUrl As String) As String Dim intL As Integer Dim intG As Integer intG = strUrl.IndexOf(">") + 1 intL = strUrl.IndexOf("<", intG) Return strUrl.Substring(intG, intL - intG) End Function
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
|