D B
asked on
Events for a label
I want to have a VB6 label control function like a hyperlink. When the user moves the mouse over the lavbel, I want to change the mouse pointer. When they click on it, I will, in code, direct them to a page in a browser. When the user moves the mouse pointer out from over the label, I want to change the pointer back to the default.
Unfortunately, the label control only has a mousemove event (I can use that to determine when the control gets focus) but no way of determining when focus is lost. Any ideas???
Doug
Unfortunately, the label control only has a mousemove event (I can use that to determine when the control gets focus) but no way of determining when focus is lost. Any ideas???
Doug
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You only need to set the properties jmundsack describes at design time. the mouse pointer will change automatically, no need to code anything.
Needs :
=====
1 Label
Const URL = "whatismyip.com"
Private Sub Form_Load()
With Label1
.Font = "arial"
.FontSize = 12
.FontUnderline = True
.Caption = URL
.Width = 2000
End With
End Sub
Public Sub gotoweb(ByVal myURL As String)
Dim Success As Long
Shell "C:\Programme\Internet Explorer\IEXPLORE.EXE " & myURL, vbNormalFocus
End Sub
Private Sub Label1_Click()
gotoweb URL
End Sub
=====
1 Label
Const URL = "whatismyip.com"
Private Sub Form_Load()
With Label1
.Font = "arial"
.FontSize = 12
.FontUnderline = True
.Caption = URL
.Width = 2000
End With
End Sub
Public Sub gotoweb(ByVal myURL As String)
Dim Success As Long
Shell "C:\Programme\Internet Explorer\IEXPLORE.EXE " & myURL, vbNormalFocus
End Sub
Private Sub Label1_Click()
gotoweb URL
End Sub
ASKER
DUH! I left my brain at home this morning :-(
ASKER