text linking to an object or a form?
okay. i made a label and change the forecolor to blue, and font made it underline...
like this one:
[FONT COLOR="BLUE"]Answers[/FONT]
and the code is:
VB Code:
Private Sub lblLink_Click()
frmAnswers.show
End Sub
is there another solution, option or recommendation? i mean any other simple way of making links to an object?....
Re: text linking to an object or a form?
Can you explain in few words what is it that you need to do?
Re: text linking to an object or a form?
Re: text linking to an object or a form?
Technically it isn't a Hyperlink, as it isn't showing a webpage :p
The way you show is the most basic way of showing the other object when you click your label.
chem
Re: text linking to an object or a form?
that's right, it is something similar...
but i want is the best or shortest method in making a text linkable to a form.
and what object should i use: a label? a textbox? or ?
that "or ?" is what i am asking... if none, i would stick with my previous code... :confused:
Re: text linking to an object or a form?
OK, you made me think for a minute ... ;)
Here is what you can do:
- set caption for selected label to whatever you want
- set Tag property to be actual form's name that you want to launch
- run the following code and let me know if it works for you:
VB Code:
Option Explicit
Private Sub Form_Load()
Label1.Caption = "Display Summary Form"
Label1.Tag = "Form2"
End Sub
Private Sub Label1_Click()
Dim frm As Form
Set frm = Forms.Add(Label1.Tag)
frm.Show
End Sub
There is a way to set "hand" cursor to a label but that would come later ...
Re: text linking to an object or a form?
not working...
okay, just want to ask how to set "hand" cursor to a label?
Re: text linking to an object or a form?
Hand cursor is the easy part, however it might not work on pre Win2K systems:
VB Code:
Option Explicit
Private Const IDC_HAND = 32649&
Private Declare Function LoadCursor Lib "user32" _
Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor Lib "user32" _
(ByVal hCursor As Long) As Long
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
SetCursor LoadCursor(0, IDC_HAND)
End Sub
Now back to the problem: what's not working? Show me what you've done so far.
1 Attachment(s)
Re: text linking to an object or a form?
Attached is a hand cursor in both ico and cur format. Just load one of them in the MouseIcon property of the Label and set the MousePointer property to 99-Custom.