Change Form Size [solved]

Posts 19 of 9 · Page 1 of 1
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
If CheckBox1.Checked = True Then
Me.Size = New Point(437, 590)
Else
Me.Size = New Point(437, 447)
End If
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.
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 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.
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.
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!
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 =)
Marked solved.
Posts 19 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?