Home > Net >  Winfrom how to implement each new form or each new TAB in the TAB control and function
Winfrom how to implement each new form or each new TAB in the TAB control and function

Time:03-25

Good bosses, the day before yesterday sent a post, basic nobody reply
Unfortunately, recently when writing a structure calculation software
To achieve similar to the following of a commercial software interface

Motor is a new button, will generate the same each new job such as interface/TAB/form, and then automatically named "project 1", "engineering 2"...
The commercial software I see his package, should be realized by c + +
Excuse me, are in c #, how through tabs, each adding a project in the new tabpage, now and then the inside of the controls and functions as
Or you have other good treatment
Urgent for our bosses!
CSDN score too few
, forgive me

CodePudding user response:

Help, ah

CodePudding user response:

Have you this project as a user interface controls

CodePudding user response:

Thank you bosses, probably searched by baidu yesterday, as if is packaging user control method, for now I c # level is general, so many controls are combined in a user control, write user controls whether code quantity is very large

CodePudding user response:

Put the same function in the UserControl, click new, new to this UserControl, then add window,

CodePudding user response:

Make a simple, changed a conveniently, reference
Link: https://pan.baidu.com/s/1FfsFio4GFWfZqZ6TACzF4g
The extracted code: 684 p
Can decide the colors, click close events, can drag, closed, etc.

CodePudding user response:

Use TabControl or XtraTabControl, can be fully realized, can add N TabPage page, what is the difficulty?

If you want to make it a UserControl encapsulated into their own, also can be completely, can write some method calls and DAL layer calls in,

CodePudding user response:

refer to 6th floor morliz son hin reply:
use TabControl or XtraTabControl, can be fully realized, can add N TabPage page, what is the difficulty?

If you want to make it a UserControl encapsulated into their own, also can be completely, can write some method calls and DAL layer called relationship,

I major in civil engineering, the level of the c # only enough to drag drag controls, complete the basic logic

CodePudding user response:

refer to 7th floor DQYDXT response:
Quote: refer to the sixth floor morliz son hin reply:
use TabControl or XtraTabControl, can be fully realized, can add N TabPage page, what is the difficulty?

If you want to make it a UserControl encapsulated into their own, also can be completely, can write some method calls and DAL layer called relationship,

I major in civil engineering, the level of the c # only enough to drag drag controls, complete the basic logic


Then you can start with the most basic WinForm control, namely the TabControl, there are a lot of new TabPage method,
Give you write a demo:
 
//will be loaded into the form form TabPage,
The static void AddToTabCtrl (Form Form, TabControl TAB, string caption)
{
Var page=new TabPage (caption);
TAB. Controls. The Add (page);
Form the TopLevel=false;
Form. ControlBox=false;
Form. BringToFront ();
Form. The Show ();
Form. The Dock=DockStyle. The Fill;
Form. FormBorderStyle=FormBorderStyle. None;
Form. The WindowState=FormWindowState. Maximized;
Page. Controls. The Add (form);
}

//note that the first form parameters can be passed, with a new line,

CodePudding user response:

reference 5 floor desperaso reply:
, make a simpler, changed a conveniently, reference
Link: https://pan.baidu.com/s/1FfsFio4GFWfZqZ6TACzF4g
The extracted code: 684 p
Can decide the colors, click close events, can drag, closed, etc.

Download bosses this really great ah, I see, is the WPF, WPF I do no
Xmal but also learning the language

CodePudding user response:

refer to the eighth floor morliz son hin reply:
Quote: refer to 7th floor DQYDXT response:
Quote: refer to the sixth floor morliz son hin reply:
use TabControl or XtraTabControl, can be fully realized, can add N TabPage page, what is the difficulty?

If you want to make it a UserControl encapsulated into their own, also can be completely, can write some method calls and DAL layer called relationship,

I major in civil engineering, the level of the c # only enough to drag drag controls, complete the basic logic


Then you can start with the most basic WinForm control, namely the TabControl, there are a lot of new TabPage method,
Give you write a demo:
 
//will be loaded into the form form TabPage,
The static void AddToTabCtrl (Form Form, TabControl TAB, string caption)
{
Var page=new TabPage (caption);
TAB. Controls. The Add (page);
Form the TopLevel=false;
Form. ControlBox=false;
Form. BringToFront ();
Form. The Show ();
Form. The Dock=DockStyle. The Fill;
Form. FormBorderStyle=FormBorderStyle. None;
Form. The WindowState=FormWindowState. Maximized;
Page. Controls. The Add (form);
}

//note that the first form parameters can be passed, with a new line,

You this I probably understand, also checked before a similar approach, which means to create a new form, inside decorate good unified control, and then put the tabcontrol from into the main interface, aren't you
Then every time a new tabpage, new a new form embedded in the new tabpage right

CodePudding user response:

reference 5 floor desperaso reply:
, make a simpler, changed a conveniently, reference
Link: https://pan.baidu.com/s/1FfsFio4GFWfZqZ6TACzF4g
The extracted code: 684 p
Can decide the colors, click close events, can drag, closed, etc.


I see what you mean, but also with user controls, aren't you
 private void Button_Click (object sender, RoutedEventArgs e) 
{
num++;
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C#
  • Related