Master forms in the form of windows

Like the main pages in ASP.NET, do we have a similar concept for a Windows Form application. So I don’t need to repeat the same part of the form (header and footer) many times through the application.

+3
source share
6 answers

Yes.

What you need to do is create a “Wizard” form, add the entire user interface, default buttons, etc.

For things like buttons, I usually create methods that handle Click events as “Virtual” so that I can implement them in the real form I create.

, "", " ". , VS.Net 2008, "Windows Forms", "Inherited Form".

, . "master" , .

+9

, .

" " UserControl . (, Contentpanel Footer - Windows.Form.Panel).

-------------------------------
| Header                      |
-------------------------------         ______________
|                             |         |            |
|         ContentPanel        |   <---- | MonkeyEdit |
|                             |         |____________|
-------------------------------
| Footer                      |
-------------------------------

public class MonkeyEdit : UserControl, IContent
{

}

, . , /, MonkeyEdit ContentPanel Dock.Fill. " ", .

+7

, , (, UserControl) , ( ) .

+1

- ; .

0

, ( ), .

0

The main page has the ability to specify the content area in which the pages will be inserted. Thus, obtaining a form, for example, form B from form A and receiving the attributes of the parent form, does not prove this point. What Bodge said makes more sense when we use panels.

0
source

Source: https://habr.com/ru/post/1706171/


All Articles