1.

Solve : VB Constant Height/Width?

Answer»

Hi am I making a program in VB.

I wander if there is any code/option that allow your form size to remain constant? So that when you start the program your form height and width always remain the same and users are not ALLOWED to change it, and also to disable to the maximize button.

Thanks To disable the maximize button, try setting the form property .maximizebox to False

To keep users from resizing the form, try setting the form property .locked to True



Both properties can be set either at design time or run time.

I guessed you using VB.NET for lack of any definite information.I don't REALLY know the difference between VB and VB.net (if there is any) but I'm using
VB 6.0 as part of the visual studios package.

I tried adding the code but it appears VB does not recognize .maximizebox or .locked, And I could find nothing in the properties panel.


SAMPLE CODE
==========
form1.maximizebox = False
form1.locked = true
(or simply) form1.locked
==========


Either way they don't work




The only reason I made the leap to VB.NET was Microsoft gave away free copies of VS2005 when I ATTENDED their launch party. VB6 is a good product, in many ways easier to use, creates smaller exe footprints, but sometimes just not all that intuitive.

To disable the maximize button, try setting the maxbutton form property to False

To prevent users from resizing the form, try setting the form border property to 1 or 3 or 4. Any value that uses a fixed border should work.

Good luck. Yes that was the right stuff thanks. Do not know how I didn't see it before.



Discussion

No Comment Found