|
-
May 12th, 2011, 11:08 AM
#1
Thread Starter
New Member
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.
-
May 12th, 2011, 11:12 AM
#2
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
-
May 12th, 2011, 11:23 AM
#3
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?
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
May 12th, 2011, 02:38 PM
#4
Addicted Member
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.
-
May 13th, 2011, 01:03 AM
#5
Thread Starter
New Member
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??
-
May 13th, 2011, 01:12 AM
#6
Addicted Member
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
-
May 13th, 2011, 01:44 AM
#7
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.
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
|