How to check if a button was clicked ?

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2008
Posts: 20
Reputation: R3B3L is an unknown quantity at this point 
Solved Threads: 0
R3B3L R3B3L is offline Offline
Newbie Poster

How to check if a button was clicked ?

 
0
  #1
Aug 9th, 2008
How do you check if a button was clicked in Visual Basic .NET ?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 66
Reputation: PsychicTide is an unknown quantity at this point 
Solved Threads: 7
PsychicTide's Avatar
PsychicTide PsychicTide is offline Offline
Junior Poster in Training

Re: How to check if a button was clicked ?

 
0
  #2
Aug 9th, 2008
Last edited by PsychicTide; Aug 9th, 2008 at 9:36 am.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 20
Reputation: R3B3L is an unknown quantity at this point 
Solved Threads: 0
R3B3L R3B3L is offline Offline
Newbie Poster

Re: How to check if a button was clicked ?

 
0
  #3
Aug 9th, 2008
tx but Niether thread answered my question.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: How to check if a button was clicked ?

 
0
  #4
Aug 9th, 2008
Hi,
> Use a boolean variable (bBtnClicked)
> Initially Keep it false (bBtnClicked = false)
> Whenever user click the button Make it True (bBtnClicked = True in Click Event)
> Now the boolean variable having the result whether button is clicked or not .
KSG
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 20
Reputation: R3B3L is an unknown quantity at this point 
Solved Threads: 0
R3B3L R3B3L is offline Offline
Newbie Poster

Re: How to check if a button was clicked ?

 
0
  #5
Aug 9th, 2008
Dim cmdClicked As Boolean = False
If (cmdClicked = True in cmdOne event) Then
End If

???
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 20
Reputation: R3B3L is an unknown quantity at this point 
Solved Threads: 0
R3B3L R3B3L is offline Offline
Newbie Poster

Re: How to check if a button was clicked ?

 
0
  #6
Aug 9th, 2008
Please anyone help,

I have a button named "cmdOne" and i want to know if it was clicked.

I created a boolean:

Dim clicked As Boolean = False
If (clicked == True) .... ????

How do I finish this ? Please Advice, I can't go on with my program without knowing how to do this and I have been stuck trying to do it over 7 hours...
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: How to check if a button was clicked ?

 
1
  #7
Aug 9th, 2008
Somewhat correct. But you have to declare the variable at Form level not inside Click Event Handler

  1. Dim bBtnClicked As Boolean = False
  2. Private Sub cmdOne_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOne.Click
  3. If bBtnClicked = True Then
  4. MessageBox.Show("This button is clicked already ....")
  5. Else
  6. MessageBox.Show("This button is clicked First time ....")
  7. End If
  8. bBtnClicked = True
  9. End Sub
KSG
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC