How would I know whether the link label was clicked at the runtime.
my code looks something like this:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
curtime.Text = TimeValue(Now) 'curtime is label
End Sub
I have a link label on my form and I want to change the value of curtime when user clicks on the link label at the run time.
something like this
curtime.Text = newtime.text 'newtime is label
I can do this coding in the link label's click event but I want newly assinged value of the curtime should be running when the form runs and this can happen only when I put the code in the timer event, that's why I want to check in the timer event itself whether the link label was clicked by user at run time.
How should I do that.
Or please tell me how to call timer sub routine.
Plz explain.
Re: How would I know whether the link label was clicked at the runtime.
That is not VB6 code.... Thread moved from 'VB6 and Earlier' forum to 'VB.Net' (VB2002 and later) forum
Re: How would I know whether the link label was clicked at the runtime.
Do you mean the text of the link label should show the current time automatically like a clock after it is clicked on or does it show the current time once and stops until the user click again?
Re: How would I know whether the link label was clicked at the runtime.
I believe you're asking that you want a running time (the label) to be constantly updating and upon clicking it, the current time when clicked will appear in the textbox?
If so, just set a timer to 1000ms (one second) with something like lblTime.Text = TimeOfDay and on the click event of the label set txtTime.Text = lblTime.Text
Don't forget to enable the timer, otherwise the time won't update.
Re: How would I know whether the link label was clicked at the runtime.
you are not understanding.Please just tell e is there any way I can test inmy code whether the link label was clicked.like:
if LinkLabelIsClicked then
code
OR is there any way I can call timer sub rotine??
Re: How would I know whether the link label was clicked at the runtime.
I'm clearly not the only person who doesn't understand what you are trying to say. Perhaps rephrasing?
Code:
Public Class Form1
Dim YourLabelWasClicked As Boolean = False
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
YourLabelWasClicked = True
End Sub
End Class
Re: How would I know whether the link label was clicked at the runtime.
You can use the settings-file to write a value when the user has clicked the link-label. Make sure you check the Settings-file before you execute. I hope you understand what I'm trying to tell you.