Home > Net >  C # about controls Tabcontrol sharing the same part of the control problems in a different TAB
C # about controls Tabcontrol sharing the same part of the control problems in a different TAB

Time:09-17

I now made a tool, used the Tabcontrol controls two interface to make it, the difference between the two interfaces, one just use, only to see the final result (don't need to see the process), the other one is on the basis of the first, according to the execution (I use textbox is used to receive the feedback information in the program execution), in this case, tag is 2 to 1 only the textbox control, in order to clearly stated in my case, simplifies the fact that more than one control, know what I mean), other are all the same, the question comes, how to do, to make the same part of the control can in two labels of the communist party of China (why not add a same control add code because so much is I do of tool control, involves the function is much, if I had to write code amount is too much, too complicated), Shared meaning is the same control can display on the two interface, function, also do not need to add, from the toolbox is equivalent to choose a control that can display in the two labels and use, as shown in figure:

CodePudding user response:

Don't write code a little dream...

CodePudding user response:

You don't put to share control don't tabcontrol inside? Don't on the tabcontrol you wouldn't write code,,,,,,,,

CodePudding user response:

You do so more tired, want to set the control into a common control, and then call when have to set the position, the incoming data, it is better to directly copy control in the past,

CodePudding user response:

To make a user control, then can in the toolbox, drag let go well where it is needed

CodePudding user response:

Made a control, public share in two TAB to add

CodePudding user response:

Make it public control reference

CodePudding user response:

Make the same into a public space, when generated from the toolbox onto the interface

CodePudding user response:

Switch to which the label is the control move to public which TAB, and then set the position.

CodePudding user response:

Make a user control

CodePudding user response:

Utility into a form, and then added to the TAB and use it every time

CodePudding user response:

About layout change, divided into upper and lower or
Write user control of the public, on top or on the left, or right below show log

Of course, you can also choose to write a, with an attribute controls whether show log

CodePudding user response:

The same things can get into user controls
  •  Tags:  
  • C#
  • Related