Click here to Skip to main content
15,897,334 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..

I make re-sizable panel and i want to set boundary to that panel(e.g when panel re-size it should not increase width of panel more than 200 and it should not goes up to less than 200 X Co-Ordinate)

If have any idea please share..
Posted

1 solution

How about changing MaximumSize property of that panel?

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.maximumsize%28v=vs.110%29.aspx[^]

[Update]
You can use some Panel's events like: LocationChanged, SizeChanged or Resize to detect when particular properties where changed and then set proper values. Here you have some links to MSDN documentation:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.locationchanged%28v=vs.110%29.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.sizechanged%28v=vs.110%29.aspx[^]
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.resize%28v=vs.110%29.aspx[^]

Cheers!
 
Share this answer
 
v2
Comments
SachinSutar 19-Dec-14 5:36am    
maximum size restrict only width. I want to restrict X Co-ordinate also (means same like control does not get more size than parent control)
Marcin Kozub 19-Dec-14 5:44am    
I don't understand what you're trying to achieve. Can you explain it a little bit more?
Update your question please.
SachinSutar 19-Dec-14 5:45am    
ok. I will update it with detail

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