Easy Question - how to refer to an event in the current form

micropathic

Well-known member
Joined
Oct 23, 2003
Messages
75
If I have a command button, and want to test whether or not it has been clicked or not, what would be the syntax to do so. For instance if the event for the clicking the command button is something like.. sync.click, how would I say:

if sync.click = true

then

end if

When I type form1 and put a period after it, the inline dropdown menu doesnt give me the option to choose sync.click.

TIA
 
The Click event is only there for calling the sub. Are you trying to determine if the button has ever been clicked?
If so, then you need to make a variable in your form class that you set to true in the Button click event, and then check this variable. :)
 
Thanks for your help, and yes I am trying to determine whether the button was clicked, but more specifically the event caused by calling the "sync.click" sub. I had thought about doing that, and havent really tried it yet, but let me ask you this if I did this:

Code:
Public Sub Sync_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Sync.Click

dim Syncing as boolean

Syncing = true


****This part contains the part of the code that performs some needed steps for my program****


Syncing = False


End Sub

Would the code wait until the "****This part contains the part of the code that performs some needed steps for my program****" portion of the code completes until setting the variable syncing to false or does that logic not really work?
 
Unless you are dealing with multiple threads or asyncronous methods (are you?) then there is no need to set and unset the syncing variable.
It may help if you provided more code or details on what you are trying to acheive.
 
Back
Top