Control button Click event

Reply

Join Date: May 2006
Posts: 39
Reputation: INI is an unknown quantity at this point 
Solved Threads: 0
INI INI is offline Offline
Light Poster

Control button Click event

 
0
  #1
Jun 14th, 2006
Guys,

I have a question, is there any way in code to determine if a button has been clicked? I want to use one form when a control button on a second form is click; I do not know how to do that, though I know it goes something like this :

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1.  
  2. if UserForm1.CommandButton. <I do not know what goes in here > = true Then
  3.  
  4. endif


Please can somebody help me out? Thank you very much.

Ini
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 85
Reputation: williamrojas78 is an unknown quantity at this point 
Solved Threads: 4
williamrojas78's Avatar
williamrojas78 williamrojas78 is offline Offline
Junior Poster in Training

Re: Control button Click event

 
0
  #2
Jun 14th, 2006
Hi

Are you trying to open up a different form - let's say form2 - from the click on a button on form1?

why don't you use the event created by the button? and then open up the form.

something like this:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub button1_Click()
  2.  
  3. form2.show
  4.  
  5. End Sub

where button1 is the name of the button in form 1.

hope it helps
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 39
Reputation: INI is an unknown quantity at this point 
Solved Threads: 0
INI INI is offline Offline
Light Poster

Re: Control button Click event

 
0
  #3
Jun 14th, 2006
I have form A that has 4 control buttons(A,B,C,and D), I have Form B which will be called up when each of these 4 buttons are pressed. I want when control A is pressed, it will open Form B with Form B title saying "A". If Control Button B is press, Form B will Open up with its label saying "B" and so on.

I hope this helps make my problem easier to answer. I am trying to use the same form for 4 different things.

INI


No, I am trying to determine if the control button on Form 1 was clicked. If
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 85
Reputation: williamrojas78 is an unknown quantity at this point 
Solved Threads: 4
williamrojas78's Avatar
williamrojas78 williamrojas78 is offline Offline
Junior Poster in Training

Re: Control button Click event

 
0
  #4
Jun 14th, 2006
Ah, ok

this is the code for the four buttons on formA

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2. Form2.Show
  3. Form2.Label1.Caption = "A"
  4. End Sub
  5.  
  6. Private Sub Command2_Click()
  7. Form2.Show
  8. Form2.Label1.Caption = "B"
  9. End Sub
  10.  
  11. Private Sub Command3_Click()
  12. Form2.Show
  13. Form2.Label1.Caption = "C"
  14. End Sub
  15.  
  16. Private Sub Command4_Click()
  17. Form2.Show
  18. Form2.Label1.Caption = "D"
  19. End Sub

where Command1, Command2, Command3 and Command4 are the buttons, and label1 in form2 will change everytime you hit a button
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 39
Reputation: INI is an unknown quantity at this point 
Solved Threads: 0
INI INI is offline Offline
Light Poster

Re: Control button Click event

 
0
  #5
Jun 14th, 2006
Thank you very much, I will try that.

Ini
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
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