开发者

Is there something like master page in desktop aplications?

开发者 https://www.devze.com 2022-12-18 09:17 出处:网络
Can I have master form that w开发者_开发技巧ill contain windows forms? Or even windows control?

Can I have master form that w开发者_开发技巧ill contain windows forms? Or even windows control?

Thanks a lot.


For a form to contain other forms, you want MDI (as Zach Johnson already said). Setting the relevant form properties (IsMdiContainer / MdiChildren / MdiParent / etc) will get you the behaviour you want.

For something like a "master page for forms", you could try using Visual Inheritance. First you define a basic "master" form layout, leaving space for the controls on the child forms. Then when you create new forms, be sure to select Add New-->Windows Forms-->Inherited Form, and Visual Studio will prompt you to select a parent form to inherit from.


You can achieve this with inheritance i suppose


I think you want to create a Multiple Document Interface (MDI). Also, all windows forms can contain controls, so you can by definition create a form that contains a control.


A winform application I work has a main form that is completely built in this manner. It uses one Winform and everything displayed on it is a user control. All the displays are written as plugins and can be pulled into the applications menu and have their user control displayed.

0

精彩评论

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