Results 1 to 4 of 4
  1. #1
    aeronyx's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    /210/
    Posts
    11,238
    Reputation
    1211
    Thanks
    5,070

    Enabling OR Disabling A Button

    Code:
    If (Form2.rbtnAuto.Checked = True) Then
                Me.btnInject.Enabled = False
            ElseIf (Form2.rbtnAuto.Checked = False) Then
                Me.btnInject.Enabled = True
            End If
    Das duh code.

    it doesn't work.

    It should, by all rights, PM me for TV info.

  2. #2
    StupidFuck's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    A box. Wont you give me money to live?
    Posts
    2,168
    Reputation
    156
    Thanks
    4,850
    Quote Originally Posted by aeronyx View Post
    Code:
    If (Form2.rbtnAuto.Checked = True) Then
                Me.btnInject.Enabled = False
            ElseIf (Form2.rbtnAuto.Checked = False) Then
                Me.btnInject.Enabled = True
            End If
    Das duh code.

    it doesn't work.

    It should, by all rights, PM me for TV info.
    Im guessing this is for an injector and this is the automatic feature. I would say switch the checkbox to a radiobox. Make one radiobox auto and one manual. It is usually done that way. Now. Yo address the button problem, I would try setting the default to disabled and the auto radiobutton to checked ( or checkbox). Then try it (even without the second part) and see if that works. If it does,.finish off the code with the rest of it. If it doesn't work or I am completly wrong about it being an injector, you can PM me or reply

  3. #3
    ClaimIT's Avatar
    Join Date
    Apr 2012
    Gender
    male
    Location
    Russia
    Posts
    73
    Reputation
    -2
    Thanks
    161
    My Mood
    Blah
    If (Form2.rbtnAuto.Checked = True) Then
    Me.btnInject.Enabled = False
    ElseIf (Form2.rbtnManual.Checked = True) Then
    Me.btnInject.Enabled = True
    End If

    but this at a timer



    IDK What Is Up There Just Was In My Mind xD


  4. #4
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by ryakhawk View Post
    Im guessing this is for an injector and this is the automatic feature. I would say switch the checkbox to a radiobox. Make one radiobox auto and one manual. It is usually done that way. Now. Yo address the button problem, I would try setting the default to disabled and the auto radiobutton to checked ( or checkbox). Then try it (even without the second part) and see if that works. If it does,.finish off the code with the rest of it. If it doesn't work or I am completly wrong about it being an injector, you can PM me or reply
    Why change to a radio button? You can't 'deselect' a radio button after you select it, so the only option is to make 2 radio buttons (On/Off), which is a waste of space when a checkbox suits the situation far better.

    @aeronyx What exactly is calling this code? I'd recommend putting the following in your rbtnAuto_CheckChanged event:

    Code:
    Form1.btnInject.Enabled = Not Me.rbtnAuto.Checked
    So that the button's state is toggled whenever you toggle the checkbox. I may have got the classes wrong because I'm not sure what you've called them (the fact you had Form2 led me to believe that you have 2 forms; Form1 and Form2.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  5. The Following User Says Thank You to Jason For This Useful Post:

    aeronyx (05-04-2012)

Similar Threads

  1. [Tutorial] Disable Close Button
    By scimmyboy in forum Visual Basic Programming
    Replies: 4
    Last Post: 02-19-2010, 11:48 AM
  2. Disabling The Alt + f4 Hotkey [Close Button]
    By nathanael890 in forum Visual Basic Programming
    Replies: 10
    Last Post: 02-14-2010, 02:59 PM
  3. [Tutorial] Disable X Button
    By NextGen1 in forum Visual Basic Programming
    Replies: 13
    Last Post: 02-09-2010, 09:07 AM
  4. Disable Exit Button?
    By Zoom in forum Visual Basic Programming
    Replies: 7
    Last Post: 01-13-2010, 03:07 PM
  5. Replies: 0
    Last Post: 01-22-2009, 01:56 AM