Support Forums

Full Version: Quick Question!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay so i want this to happen

If button1.enable = true then
button2.enable = true

(codes prob wrong but thats not the issue)

Where would i put that so its always checking?
Its pretty simple. Just put the codes in each button.

When you click on Button1 make it
button2.enabled = true

Or vise versa. You can do that with anything, just put it inside the buttons.

Or you could probably make it work on form load.


Edit: Sorry I didnt understand it at first. But now I get what your saying.
I would put this in the form load.

if button1.enabled = true then
button2.enabled = true

Thats the right code.

If you need more help you can add me on MSN
If you want this to be checked at each second you can use a timer and add that code to the time's tick event. You can also set a different interval so that it checks every 10 millisecs, for example.
Put a timer on your form and set the interval to 5000 thats every 5 seconds.

In the timer code put your code from above.
Don't use a timer. If you have have it changing throughout your program just use this
Code:
Private Sub Button1_EnabledChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.EnabledChanged
        If Button1.Enabled = True Then
            Button2.Enabled = True
        Else
            Button2.Enabled = False
        End If
End Sub