开发者

resizing windows forms elements

开发者 https://www.devze.com 2022-12-14 07:36 出处:网络
i have a form with few panels docked to top,left and fill... And there are two buttons inside a panel...i want to resize the button which should not overlap 开发者_如何学Gowhen form is resizedI you ar

i have a form with few panels docked to top,left and fill... And there are two buttons inside a panel... i want to resize the button which should not overlap 开发者_如何学Gowhen form is resized


I you are inside Windows Forms, then this supports obvisouly control nesting. So as you have added and docked your three panels you can then add buttons to these panels and Dock any child elements inside.

For example, if we take what you have described, if we focus on your panel which is Dccked on the left, you could then add the follwing:

ParentPanel = parentPanel1

  1. Add a Child Panel chdPanel1 to parentPanel1 - Dock Bottom, Padding : All 5
  2. Add a Child Panel chdPanel2 to parentPanel1 - Dock Fill, Padding : All 5
  3. Add a Button btn1 to chdPanel1 - Dock Fill

This is just an example, but if you continue with control nesting and docking correctly, you should have no problem in positioning your controls

Andrew

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号