|
-
July 11th, 2001, 10:49 AM
#1
How can you do this?
Hi,
I have a button. When I press that button, 2 more buttons appear :
Button2.Visible = True
Button3.Visible = True.
But, when I press the main button again, they don`t go away, they stay there.
What is the code, so that when the main button is clicked the next time, the other 2 buttons disappear again?
Thanks
Mark
-
July 11th, 2001, 10:53 AM
#2
Re: How can you do this?
Define the boolean var on the form level
dim bBool as boolean
on Button1_Click evnt
if Not bBool then
Button2.Visible = True
Button3.Visible = True.
else
Button2.Visible = False
Button3.Visible = False
end if
bBool = Not bBool
Iouri Boutchkine
[email protected]
-
July 11th, 2001, 11:38 AM
#3
Re: How can you do this?
Or even:
private Sub Button1_Click()
Button2.Visible = Not Button2.Visible
Button3.Visible = Button2.Visible
End Sub
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
-
July 31st, 2001, 07:06 AM
#4
Re: How can you do this?
Dear Jones
Your Answer of making visible false is Impressive but I think there is one
mistake you forgot to put "Not" in your statement Otherwise liked your answer.
private sub Command1_Click()
Command2.visible = Not Command2.visible
Command3.visible = Not Command3.visible
End Sub
Deepak Adlakha.
-
July 31st, 2001, 07:11 AM
#5
Re: How can you do this?
No - on the second line, I have:
Button3.Visible = Button2.Visible
Which ensures that no matter what happens, both buttons are either visible or hidden. In your example if one were hidden and the other visible then clicking button1 would swap them over.
Hope this helps,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
-
August 2nd, 2001, 07:32 PM
#6
Re: How can you do this?
You also could use:
If button2.visible = true then
button2.visible = false
button3.visible = false
else
button2.visible = true
button3.visible = true
end if
-
August 27th, 2001, 04:24 AM
#7
Re: How can you do this?
Private Sub command1_Click()
command2.visible = not command2.visible
command3.visible = not command3.visible
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|