Copying GroupBox
-
I created a GroupBox(groupBox1) that contains textBox and buttons(i created this with the design option on the Form).groupBox1 is on a Tab that i created it also on the design option. After Clicking on a specific button(no matter where) the app opens a new Tab. i want that the new Tab(tab2) will has the same groupbox1(a copy of the first-not a reference)..How can i do it?:confused: I tried this:
GroupBox g = new GroupBox();
// g.copy(groupBox1) the method 'copy' do not exist
// g=groupbox1 will be Reference;
// i want that 'g' will be exactly like 'groupbox1'Thank you for your attention G.
-
I created a GroupBox(groupBox1) that contains textBox and buttons(i created this with the design option on the Form).groupBox1 is on a Tab that i created it also on the design option. After Clicking on a specific button(no matter where) the app opens a new Tab. i want that the new Tab(tab2) will has the same groupbox1(a copy of the first-not a reference)..How can i do it?:confused: I tried this:
GroupBox g = new GroupBox();
// g.copy(groupBox1) the method 'copy' do not exist
// g=groupbox1 will be Reference;
// i want that 'g' will be exactly like 'groupbox1'Thank you for your attention G.
-
Marking an answer as bad because you're not able to understand it, is not a good way to get people to want to help you.
Christian Graus Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
-
i'll try to help with simple solution 1. create user control contains your groupbox 2. in the form designer, place that user control in your tab 3. if the specific button you mention before clicked, add new tab, create new instance of user control described above, place that control in your new tab 4. if you don't understand what i talk about you must : - understand what is OOP - understand how to create and place control in parent control at runtime
dhaim program is hobby that make some money as side effect :)
-
I created a GroupBox(groupBox1) that contains textBox and buttons(i created this with the design option on the Form).groupBox1 is on a Tab that i created it also on the design option. After Clicking on a specific button(no matter where) the app opens a new Tab. i want that the new Tab(tab2) will has the same groupbox1(a copy of the first-not a reference)..How can i do it?:confused: I tried this:
GroupBox g = new GroupBox();
// g.copy(groupBox1) the method 'copy' do not exist
// g=groupbox1 will be Reference;
// i want that 'g' will be exactly like 'groupbox1'Thank you for your attention G.
You can't actually have a reference, a control can only be in one place at a time, so you've got no problem there. Like people have said, you will need to create a new instance of the controls and add these new controls to the tab. To see how you can create, setup, and add controls, just check the designers generated code.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius