micropathic Posted December 11, 2003 Posted December 11, 2003 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 Quote
Leaders Iceplug Posted December 11, 2003 Leaders Posted December 11, 2003 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. :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
micropathic Posted December 11, 2003 Author Posted December 11, 2003 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? Quote
Administrators PlausiblyDamp Posted December 11, 2003 Administrators Posted December 11, 2003 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.