Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quick Question!
#1
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?
Reply
#2
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
"Death smiles at us all. All a man can do is smile back".
[Image: siggy.png]
MSN: Xzotic@live.com
Reply
#3
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.
My software company: Porosis Software
Games: Terrantula
Apps: Mathanasis, ColorGrabber
Reply
#4
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.
Reply
#5
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Quick Question ruk00112 7 1,217 09-25-2010, 12:10 AM
Last Post: ruk00112

Forum Jump:


Users browsing this thread: 1 Guest(s)