LlbLink class
One link of a LinkLabel: its text, its address, its name and its state. A program gets one from the control’s Links collection, from SelectedItem and HitTest, and as the Link argument of the control’s events.
LinkLabel1.Caption = "<A HREF=""https://example.com/docs"" ID=""docs"">Documentation</A>"
With LinkLabel1.Links(1)
Debug.Print .Caption
Debug.Print .IDName
.Visited = True
.Enabled = False
Debug.Print .Visited
Debug.Print .Enabled
End With
' Output:
' Documentation
' docs
' True
' False
An LlbLink stands for the link of its number, not for a link it once was. Every property reads and writes the control at the time of the call, so an object kept in a variable while the control’s caption changes is then the link that has that number in the new caption. Where the new caption has no link of that number, its properties return empty strings and False.
A program cannot make an LlbLink object with New.
Properties
Caption
The text of the link, without its marks. String. An assignment puts the new text in the link’s place in the control’s Caption, and with that makes all the links again from the marks: see The caption and its links.
Enabled
Whether the link takes a click and the Enter key. Boolean. A new link is enabled.
Height, Left, Top, Width
The place and the size of the link in the control, in the scale units of the control’s container, Left and Top measured from the control’s top left corner. Single, read-only.
An assignment to any of the four raises run-time error 383.
Hot
Whether the link is the hot one, drawn as the link under the pointer is. Boolean. With the control’s HotTracking the control sets it as the pointer moves.
IDName
The name of the link, a string of the program’s own by which a handler can tell the links apart. String. It is the ID of the link’s mark in the caption, or what the program assigned.
Index
The number of the link in the LlbLinks collection, from 1. Long, read-only.
Selected
Whether the link has the focus rectangle of the control. Boolean. Setting it to True selects this link in place of the one that was selected.
URL
The address of the link. String. It is the HREF of the link’s mark in the caption, or what the program assigned. The control does nothing with it: a LinkActivate handler reads it. It is the default member, so a link used as a value gives its address.
Visited
Whether the link is marked as one that the user has followed: the LIS_VISITED state of the link control of Windows. Boolean. The control never sets it: a LinkActivate handler does. With visual styles, Windows draws a visited link in the same color as the others.