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. TabControl problem

TabControl problem

Scheduled Pinned Locked Moved C#
helptutorialquestion
5 Posts 2 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.
  • P Offline
    P Offline
    prgr
    wrote on last edited by
    #1

    I have a form with a tabcontrol(with 2 tabpages) and I add a new TabControl at runtime using this->Controls->Add(gcnew TabControl()); Its been created at top left corner of windows and not visible fully..how to control its location/size etc? how to access it? Thanx in advance

    R 1 Reply Last reply
    0
    • P prgr

      I have a form with a tabcontrol(with 2 tabpages) and I add a new TabControl at runtime using this->Controls->Add(gcnew TabControl()); Its been created at top left corner of windows and not visible fully..how to control its location/size etc? how to access it? Thanx in advance

      R Offline
      R Offline
      Ranjan Banerji
      wrote on last edited by
      #2

      I think you need to be in the C++ message boards. Anyway, you could do something like: TabControl* tabCtrl = new TabControl(); this->Controls->Add( tabCtrl ); Now use tabCtrl to get its position etc.

      My pointless rants meragussa.blogspot.com[^]

      P 1 Reply Last reply
      0
      • R Ranjan Banerji

        I think you need to be in the C++ message boards. Anyway, you could do something like: TabControl* tabCtrl = new TabControl(); this->Controls->Add( tabCtrl ); Now use tabCtrl to get its position etc.

        My pointless rants meragussa.blogspot.com[^]

        P Offline
        P Offline
        prgr
        wrote on last edited by
        #3

        oops.. wrong section.. I cant do the way u describe...as I have to create some tabcontrols dynamically at runtime but not at design time

        R 1 Reply Last reply
        0
        • P prgr

          oops.. wrong section.. I cant do the way u describe...as I have to create some tabcontrols dynamically at runtime but not at design time

          R Offline
          R Offline
          Ranjan Banerji
          wrote on last edited by
          #4

          I still do not see why you cannot do that. perhaps a little more code from what you are attempting to do will be useful. You could do something like. void MyPage::CreateTabControl() { TabControl * tab = new TabControl(); Controls->Add( tab ); SizeAndPositionTab( tab ); //Put you size and position code in here } Now call CreateTabControl() dynamically from wherever in your code.

          My pointless rants meragussa.blogspot.com[^]

          P 1 Reply Last reply
          0
          • R Ranjan Banerji

            I still do not see why you cannot do that. perhaps a little more code from what you are attempting to do will be useful. You could do something like. void MyPage::CreateTabControl() { TabControl * tab = new TabControl(); Controls->Add( tab ); SizeAndPositionTab( tab ); //Put you size and position code in here } Now call CreateTabControl() dynamically from wherever in your code.

            My pointless rants meragussa.blogspot.com[^]

            P Offline
            P Offline
            prgr
            wrote on last edited by
            #5

            Thanx for ur reply. But this is applicable to one tab bcos I am going to specify its location. But at runtime I want to call this function(for eg: 20 times) then I cant see 20 tabcontrols as each one overwrites one another.Hope u understand my problem

            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