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. help in tab control

help in tab control

Scheduled Pinned Locked Moved C#
questionhelptutorial
3 Posts 3 Posters 1 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.
  • M Offline
    M Offline
    michaelgr1
    wrote on last edited by
    #1

    Hello, I have many tab pages in my tabcontrol. The tabpages are shown in one line. How can i do so the tabpages will be in 2 lines (for example 5 in the upper and 5 in the lower etc)?

    OriginalGriffO Z 2 Replies Last reply
    0
    • M michaelgr1

      Hello, I have many tab pages in my tabcontrol. The tabpages are shown in one line. How can i do so the tabpages will be in 2 lines (for example 5 in the upper and 5 in the lower etc)?

      Z Offline
      Z Offline
      zafersavas
      wrote on last edited by
      #2

      Have a look at this:

          private void Form1\_Load(object sender, EventArgs e)
          {
              TabControl tabControl1 = new TabControl();
              TabPage tabPage1 = new TabPage();
              TabPage tabPage2 = new TabPage();
              TabPage tabPage3 = new TabPage();
              TabPage tabPage4 = new TabPage();
              TabPage tabPage5 = new TabPage();
              Label label1 = new Label();
      
              // Allows multiple rows of tabs in the tabControl1 tab strip.
              tabControl1.Multiline = true;
      
              tabControl1.SizeMode = TabSizeMode.FillToRight;
              tabControl1.Padding = new Point(15, 5);
              tabControl1.Controls.AddRange(new Control\[\] {
              tabPage1, tabPage2, tabPage3, tabPage4, tabPage5});
              tabControl1.Location = new Point(35, 65);
              tabControl1.Size = new Size(220, 180);
      
              // Gets the number of rows currently in the tabControl1 tab strip.
              // Assigns int value to the rows variable.
              int rows = tabControl1.RowCount;
      
              label1.Text = "There are " + rows.ToString() +
                  " rows of tabs in the tabControl1 tab strip.";
              label1.Location = new Point(35, 25);
              label1.Size = new Size(220, 30);
      
              Size = new Size(300, 300);
              Controls.AddRange(new Control\[\] { label1, tabControl1 });
          }
      

      zafer

      1 Reply Last reply
      0
      • M michaelgr1

        Hello, I have many tab pages in my tabcontrol. The tabpages are shown in one line. How can i do so the tabpages will be in 2 lines (for example 5 in the upper and 5 in the lower etc)?

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        You could try Google[^] You could try reading the documentation[^] You could try reading the "how to get an answer to your question" at the top of the page. All of these are quicker than "post and pray"

        No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        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