Got two textbox’s one represents the form’s width, and the another height.
When the form loads it displays the size of the form’s width, and height in each textbox.
When you resize the form it’ll automatically update the text in the texbox’s and tell you what the form’s current size is.
How can I do this?
I used the code below so you can set the size you want and then it applys it to the form’s size, but still haven’t figured out how to automatically detect the form’s width, and height when it’s resized.
Private sizew As Integer
Private sizey As Integer
sizew = TextBox1.Text
sizey = TextBox2.Text
Me.Size = New System.Drawing.Size(sizew, sizey)
Figured out what I was doing wrong. For those that wonder how to do this, here’s the code below.
Private sizew As Integer
Private sizey As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = Me.Size.Width()
TextBox2.Text = Me.Size.Height()
End Sub
Private Sub Form1_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
TextBox1.Text = Me.Size.Width()
TextBox2.Text = Me.Size.Height()
End Sub
Handle the
SizeChangedevent and readMe.Size.