I know that I can set it up in the property window but I need to do it in code. How?
AngelicOne
4
Posting Whiz
Recommended Answers
Jump to PostWhy do you want to use Lock?
To prevent user can resize form?
If so, you use form`s properties like: MaximizeBox, MinimizeBox, like://on form1: Form2 form2 =new Forms(); form2.MaximizeBox = false; form2.MinimizeBox = false;
Or is there anything else you want to use Lock?
Jump to PostThe Locked property is a design type only property that only affects if you can move/resize the form inside the designer. To prevent resizing set FormBorderStyle to one of FormBorderStyle.Fixed3D, FormBorderStyle.FixedDialog, FormBorderStyle.Single, FormBorderStyle.ToolWindow. If you want to prevent min/max, then set MaximizeBox to false and MinimizeBox to false.
All 7 Replies
Momerath
1,327
Nearly a Senior Poster
Featured Poster
Mitja Bonca
557
Nearly a Posting Maven
AngelicOne
commented:
thanks! got it
+1
AngelicOne
4
Posting Whiz
Mitja Bonca
557
Nearly a Posting Maven
Momerath
1,327
Nearly a Senior Poster
Featured Poster
AngelicOne
commented:
thanks! got it
+1
AngelicOne
4
Posting Whiz
brokenarrow_vip
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.