Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Copying GroupBox

Copying GroupBox

Scheduled Pinned Locked Moved C#
questiondesign
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Admin887
    wrote on last edited by
    #1

    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.

    R A 2 Replies Last reply
    0
    • A Admin887

      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.

      R Offline
      R Offline
      rah_sin
      wrote on last edited by
      #2

      i think u need to add these controls run time to the collection of controls of tab.

      rahul

      A 1 Reply Last reply
      0
      • R rah_sin

        i think u need to add these controls run time to the collection of controls of tab.

        rahul

        A Offline
        A Offline
        Admin887
        wrote on last edited by
        #3

        How can i do it?

        C M 2 Replies Last reply
        0
        • A Admin887

          How can i do it?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • A Admin887

            How can i do it?

            M Offline
            M Offline
            Mbah Dhaim
            wrote on last edited by
            #5

            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 :)

            1 Reply Last reply
            0
            • A Admin887

              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.

              A Offline
              A Offline
              Anthony Mushrow
              wrote on last edited by
              #6

              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

              Game Programming articles start -here[^]-

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups