Results 1 to 9 of 9
  1. #1
    muddy175's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    idk
    Posts
    7
    Reputation
    10
    Thanks
    0

    Change Form Size [solved]

    I am trying to get my form to change size based on whether a checkbox is checked or not. this is my code but it says that
    Code:
    Value of type 'String' cannot be converted to 'System.Drawing.Size'.
    I feel REALLY stupid not knowing this one. Anyone help?
    Code:
        Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
            If CheckBox1.Checked = True Then
                Me.Size = "437, 590"
            Else
                Me.Size = "437, 447"
            End If
        End Sub
    End Class

  2. #2
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    If CheckBox1.Checked = True Then
    Me.Size = New Point(437, 590)
    Else
    Me.Size = New Point(437, 447)
    End If

  3. The Following User Says Thank You to Lyoto Machida For This Useful Post:

    muddy175 (06-10-2011)

  4. #3
    MugNuf's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    790
    Reputation
    9
    Thanks
    160
    My Mood
    Goofy
    Or you could do this
    Code:
        Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
            If CheckBox1.Checked = True Then
                Me.Size = New System.Drawing.Size(437, 590)
            Else
                Me.Size = New System.Drawing.Size(437, 447)
            End If
        End Sub
    Another thing, you really don't need this in a timer. Just double click your checkbox and add the code there.
    Last edited by MugNuf; 06-09-2011 at 08:06 PM.

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

    muddy175 (06-10-2011)

  6. #4
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,682
    My Mood
    Breezy
    Quote Originally Posted by Lyoto Machida View Post
    If CheckBox1.Checked = True Then
    Me.Size = New Point(437, 590)
    Else
    Me.Size = New Point(437, 447)
    End If
    Wrong class mate, it's New Size... lol.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  7. #5
    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 master131 View Post
    Wrong class mate, it's New Size... lol.
    Actually, both are applicable. Both are 8-byte structures with 2 4-byte members.

    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)

  8. #6
    SubCub's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Clarion, Pa
    Posts
    695
    Reputation
    -32
    Thanks
    120
    My Mood
    Cheerful
    Quote Originally Posted by Jason View Post


    Actually, both are applicable. Both are 8-byte structures with 2 4-byte members.
    sorry jason's a fuckin beast and he's right.

  9. #7
    muddy175's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    idk
    Posts
    7
    Reputation
    10
    Thanks
    0
    Thanked guys! thanks for helpin me out

    Quote Originally Posted by Lyoto Machida View Post
    If CheckBox1.Checked = True Then
    Me.Size = New Point(437, 590)
    Else
    Me.Size = New Point(437, 447)
    End If

    This is the one I used!
    Just cuz it was first. Thank you all for ur answers though!
    Last edited by muddy175; 06-10-2011 at 10:51 AM.

  10. #8
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive

    Red face

    Quote Originally Posted by muddy175 View Post
    Thanked guys! thanks for helpin me out




    This is the one I used!
    Just cuz it was first. Thank you all for ur answers though!
    Glad to help =)

  11. #9
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Marked solved.

    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)