Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 doesn't give me the option to choose sync.click.

 

TIA

  • Leaders
Posted

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. :)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted

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 haven't really tried it yet, but let me ask you this if I did this:

 

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...