Need to code a click event to toggle

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using buttons on a toolbar and I want to use the buttons as toggles. When I click the button the first time I want my picture box to display by setting the picture box to visible. But I need to add a button click event that handles the second click to set the picture box to invisible. How do I do that? This is what I am thinking will help make it toggle. I am new to VB....does this make sense or is there a better way to handle this?
 
To toggle between setting the visable property false and true try in the
click event

if mypicturebox.visable=true then
mypicturebox.visable=false
else
mypicturebox.visable=true
end if

Niclas
kimmie said:
I am using buttons on a toolbar and I want to use the buttons as toggles.
When I click the button the first time I want my picture box to display by
setting the picture box to visible. But I need to add a button click event
that handles the second click to set the picture box to invisible. How do I
do that? This is what I am thinking will help make it toggle. I am new to
VB....does this make sense or is there a better way to handle this?
 
Back
Top