Hide button

RonnieODIN

Registered User.
Local time
Today, 08:55
Joined
Jun 15, 2012
Messages
46
Hi all,

I would like to have 3 buttons on a form. When clicking Button1, Button2 and Button3 should be shown and Button1 hidden. When clicking Button3, Button2 and Button3 should be hidden and Button1 shown.

How can I do this when it is not possible to manage the object being clicked? :confused:

I tried the following which did not work because of managing an object clicked is not allowed.

Code:
Private Sub Button1_Click()
    Button1.Visible = False
    Button2.Visible = True
    Button3.Visible = True
End Sub

Private Sub Button3_Click()
    Button1.Visible = True
    Button2.Visible = False
    Button3.Visible = False
End Sub

Any help will be appreciated.

Thanks,
-Ronnie.
 
Change the focus to another control...
Code:
Private Sub Button1_Click()
    [B]someOtherControl.SetFocus[/B]
    Button1.Visible = False
    Button2.Visible = True
    Button3.Visible = True
End Sub

Private Sub Button3_Click()
    [B]someOtherControl.SetFocus[/B]
    Button1.Visible = True
    Button2.Visible = False
    Button3.Visible = False
End Sub
 
Thanks Paul.

That really was a quick fix. :)
 

Users who are viewing this thread

Back
Top Bottom