Click here to Skip to main content
16,008,010 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,
I am using custom user control window. I want to fix size of user control window on run time.
Posted
Comments
Sergey Alexandrovich Kryukov 23-Oct-12 1:25am    
Not a question.
--SA

1 solution

There is nothing about controls which happens not in run-time, so the question (which is not even a question) makes little to no sense. After all, look at your auto-generated code and see what's going on.

To change the size, use the properties System.Windows.Forms.Control.Size, System.Windows.Forms.Control.Width and System.Windows.Forms.Control.Height:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx[^].

If you really need to "fix" the size, it sounds suspicious. It it was wrong and needs fix, you need to think why it's wrong in first place. In particular, you should avoid using explicit sizes and positions and use docking and Padding.

But what you really need is this:
Microsoft Q209354.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900