How do I increase a form size with the click of a button? I tried
Me.Size.Height but that does not work! I always get an error. How do I fix it?
Printable View
How do I increase a form size with the click of a button? I tried
Me.Size.Height but that does not work! I always get an error. How do I fix it?
Try
This will increase the forms height with 60VB Code:
Me.Height += 60
You cannot edit the Height and Width through the Size property because a Size object is a value type object. If you want to change just the Height or just the Width then the form has properties so named:If you want to set them both though you should set the Size property. You do this by creating a new Size object:VB Code:
Me.Height = 200 Me.Width = 300The same applies to the Location property. You can set the Top and Left individually or you can create a new Point object and assign it to the Location property.VB Code:
Me.Size = New Size(300, 200)
That code works perfect. Thanks JM!