Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How do you lock the size of your windows forms?

I've tried giving it a defined width and setting the "Locked" property = True but it's just not working.

Yet the description of the Locked Property is "The locked property determines if we can move or resize the control"

 

I must be missing something?

Posted

set FormBorderStyle to FixedSingle.

User won't be able to resize it anymore

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Posted

A Workaround?

 

How do you lock the size of your windows forms?

I've tried giving it a defined width and setting the "Locked" property = True but it's just not working.

Yet the description of the Locked Property is "The locked property determines if we can move or resize the control"

 

I must be missing something?

I know this is not really an answer, but one possible workaround might be to set the Height and Width properties to your pre-defined size in the Resize event. It's not perfect, but at least the Form will always "snap" back to the desired size until you get a real answer.
Never ascribe to malice that which is adequately explained by incompetence. - Napoleon Bonaparte
Posted
That is what we call a patch. A solution that you use when you don't know how to make it work by conventionnal way. :p

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

  • *Experts*
Posted
You can also set the form's minimum and maximum size to your set value either in designer or runtime modes, but the FixedSingle border style is really the "best" solution for the user.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Posted

Yep. Minimum and maximum size are used in WMP. When you have a content in the center that can be expanded and that on the border there's menu. Minimum and Maximum are used to make sure that menu will still be available.

 

They are a way better use than on the Resize (unless you don't "see" the resize). But the best for this solution still FormBorderStyle to FixedSingle

"If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown

"Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me

"A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend.

C# TO VB TRANSLATOR

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...