TalkingHelpHow to Disable a button when....

Posts 1–15 of 18 · Page 1 of 2
How to Disable a button when....
How Do i Disable a button when a Radiobutton is check?


im making my Frist injecter and its working but few issus



thanks you
Here is the code

Copy this into the radio button

If Me.RadioButton1.Checked Then
Button1.Enabled = False
Else
Button1.Enabled = True
End If
Create a Timer:
Interval = 1
Enabled = True

Paste this:

Code:
If Radiobutton1.Checked = True Then
Button1.Enabled = 0
Else
'If Radiobutton1 is not checked do this 
Button1.Enabled = 1
End if
Quote Originally Posted by timiostimio View Post
Create a Timer:
Interval = 1
Enabled = True

Paste this:

Code:
If Radiobutton1.Checked = True Then
Button1.Enabled = 0
Else
'If Radiobutton1 is not checked do this 
Button1.Enabled = 1
End if
it works without timer-__-
Quote Originally Posted by GERMANY132816 View Post
it works without timer-__-
I know -.-
Or a more simplified example using the Radiobutton own checkchanged event.
If/else is not needed here...
Code:
    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        Button1.Enabled = RadioButton1.Checked
    End Sub
This is all you need
Code:
Button1.Enabled = RadioButton1.Checked
Just rename them to match your controls.

But if you wish to have it the other way around so the button is disabled when the radiobutton is checked..
Code:
Button1.Enabled = Not RadioButton1.Checked
Quote Originally Posted by Pingo View Post
Or a more simplified example using the Radiobutton own checkchanged event.
If/else is not needed here...
Code:
    Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        Button1.Enabled = RadioButton1.Checked
    End Sub
This is all you need
Code:
Button1.Enabled = RadioButton1.Checked
Just rename them to match your controls.

But if you wish to have it the other way around so the button is disabled when the radiobutton is checked..
Code:
Button1.Enabled = Not RadioButton1.Checked
^ This makes perfect sense.

"Button1.Enabled" can only = true or false.
Meaning, Button1.Enabled (True or False) is depending on whether RadioButton1 is checked or not.

How the whole code works

Code:
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged'This event triggers whenever RadioButton1 is checked or uncheckedButton1.Enabled = RadioButton1.Checked'Button1 enabled property is true or false depending on whether RadioButton1 being checked or not, which can only be either true or false since its a booleanEnd Sub
this is much more complicated
Quote Originally Posted by GERMANY132816 View Post
this is much more complicated
How so?
Button1.Enabled is a boolean, 0 = false 1 = true
RadioButton1.Checked is also a boolean

boolean 1 = boolean 2
Button1.Enabled = RadioButton1.Checked
Thank you all this was alot of help my only ploblem now is that my auto inject dont work but its oki

I'm try to find some Tut so i can learn VB
Learn VB before you try to make an injector...
Kinda complicated I guess
Quote Originally Posted by I EAT COCK View Post
Kinda complicated I guess
Seriously, stop fucking spamming.
Quote Originally Posted by Kallisti View Post


Seriously, stop fucking spamming.
How 'bout no?
Quote Originally Posted by I EAT COCK View Post


How 'bout no?
This is an easy peasy question, and you are saying it's pretty complicated. Shows you have 0 experience in programming, and are just trying to spam to get to 1337 posts, so gtfo.
Posts 1–15 of 18 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us