Change the state of a toggle button without running the click event 
Author Message
 Change the state of a toggle button without running the click event

When I click a button I want another button (a toggle) to change from
deppressed to undepressed. so I just say: ToggleButton.Value = False

Trouble is when it runds it goes to the click event for that button which I
don't want to run, I just want to change it's state. Anyone know a
workaround or how to access the state property of the button alone?

Thanks for your help, kind rgds, Mark



Tue, 17 Aug 2004 20:44:19 GMT  
 Change the state of a toggle button without running the click event
Public bStopEvents as Boolean

Private Sub togglebutton1_Click()
   if bStopEvents then Exit sub
   ' rest of your code
End Sub

Private Sub CommandButton1_Click()
   bStopEvents = True
   ToggleButton1.Value = False
   bStopEvents = False
End Sub

Regards,
Tom Ogilvy


Quote:
> When I click a button I want another button (a toggle) to change from
> deppressed to undepressed. so I just say: ToggleButton.Value = False

> Trouble is when it runds it goes to the click event for that button which
I
> don't want to run, I just want to change it's state. Anyone know a
> workaround or how to access the state property of the button alone?

> Thanks for your help, kind rgds, Mark



Tue, 17 Aug 2004 21:08:55 GMT  
 Change the state of a toggle button without running the click event
You could set the SpecialEffect Property on the toggle button to either the
value '2' or to 'fmSpecialEffectSunken', then the toggle button would appear
as pressed, and again, set this same property to either as the value '1' or
to 'fmSpecialEffectRaised' to have it appear as depressed.

Ronald Dodge
Production Statistician
Master MOUS 2000


Quote:
> When I click a button I want another button (a toggle) to change from
> deppressed to undepressed. so I just say: ToggleButton.Value = False

> Trouble is when it runds it goes to the click event for that button which
I
> don't want to run, I just want to change it's state. Anyone know a
> workaround or how to access the state property of the button alone?

> Thanks for your help, kind rgds, Mark



Tue, 17 Aug 2004 21:48:00 GMT  
 Change the state of a toggle button without running the click event
Dear Tom,

Works like a dream. As Always, many thanks (wish i didn't have to program
only in my spare time when I'm tired!!!).


Quote:
> Public bStopEvents as Boolean

> Private Sub togglebutton1_Click()
>    if bStopEvents then Exit sub
>    ' rest of your code
> End Sub

> Private Sub CommandButton1_Click()
>    bStopEvents = True
>    ToggleButton1.Value = False
>    bStopEvents = False
> End Sub

> Regards,
> Tom Ogilvy



> > When I click a button I want another button (a toggle) to change from
> > deppressed to undepressed. so I just say: ToggleButton.Value = False

> > Trouble is when it runds it goes to the click event for that button
which
> I
> > don't want to run, I just want to change it's state. Anyone know a
> > workaround or how to access the state property of the button alone?

> > Thanks for your help, kind rgds, Mark



Tue, 17 Aug 2004 21:43:30 GMT  
 Change the state of a toggle button without running the click event
Thanks for that Ronald. Kind regards from Singapore, Mark


Quote:
> You could set the SpecialEffect Property on the toggle button to either
the
> value '2' or to 'fmSpecialEffectSunken', then the toggle button would
appear
> as pressed, and again, set this same property to either as the value '1'
or
> to 'fmSpecialEffectRaised' to have it appear as depressed.

> Ronald Dodge
> Production Statistician
> Master MOUS 2000



> > When I click a button I want another button (a toggle) to change from
> > deppressed to undepressed. so I just say: ToggleButton.Value = False

> > Trouble is when it runds it goes to the click event for that button
which
> I
> > don't want to run, I just want to change it's state. Anyone know a
> > workaround or how to access the state property of the button alone?

> > Thanks for your help, kind rgds, Mark



Tue, 17 Aug 2004 22:47:14 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Repost: (workaround no good) Change the state of a toggle button without running the click event

2. How to toggle between button states on click?

3. Using a button to toggle between states

4. Toggle Button State

5. state of a toggle button

6. Append Query Running from a button click event

7. How to specify the state of a toggle button

8. Emulating state toggle buttons (Word 2000)

9. Click event code takes 3 clicks to run

10. Toggle Click Event


 
Powered by phpBB® Forum Software © phpBB Group