| | |
Control button Click event
![]() |
•
•
Join Date: May 2006
Posts: 39
Reputation:
Solved Threads: 0
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 :
Please can somebody help me out? Thank you very much.
Ini
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)
if UserForm1.CommandButton. <I do not know what goes in here > = true Then endif
Please can somebody help me out? Thank you very much.
Ini
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:
where button1 is the name of the button in form 1.
hope it helps
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)
Private Sub button1_Click() form2.show End Sub
where button1 is the name of the button in form 1.
hope it helps
•
•
Join Date: May 2006
Posts: 39
Reputation:
Solved Threads: 0
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
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
Ah, ok
this is the code for the four buttons on formA
where Command1, Command2, Command3 and Command4 are the buttons, and label1 in form2 will change everytime you hit a button
this is the code for the four buttons on formA
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Command1_Click() Form2.Show Form2.Label1.Caption = "A" End Sub Private Sub Command2_Click() Form2.Show Form2.Label1.Caption = "B" End Sub Private Sub Command3_Click() Form2.Show Form2.Label1.Caption = "C" End Sub Private Sub Command4_Click() Form2.Show Form2.Label1.Caption = "D" End Sub
where Command1, Command2, Command3 and Command4 are the buttons, and label1 in form2 will change everytime you hit a button
![]() |
Similar Threads
- Passing value of string from one button click event to another (ASP.NET)
- Calling button-click events from different classes (Python)
- Click event >> window appears? (Python)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Searching for a word in excel /vb using .findNext
- Next Thread: Need help with a certain part to a hangman game..
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





