Results 1 to 3 of 3

Thread: New Tab Button on a TabPage?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    78

    New Tab Button on a TabPage?

    Hi I was wondering if It is possible to have a "new tab" button on a tabpage, like in IE how theres the little square you click to add a new tab. So normally I use a seperate button (like on a toolstrip) to create a new tab, but I want to have a button that floats next to the last tabpage in a tabcontrol that adds tabs

    Also, if anyone knows how, it would be great to have a little button at the end of each tab that you can click to close the tab, like in google chrome (I have an attachment, something as close as possible to that would be great
    like this is a normal "tabpage button"(the button where you click to show whatever is in the tab) [Tab Text.... ] and I want something like [Tab Text.... X] where the X is a button that closes the tab

    Thanks!

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: New Tab Button on a TabPage?

    You could just keep adding a new 'tab' to the tab collection each time the "+" tab is clicked, and moving the "+" to the end.

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: New Tab Button on a TabPage?

    Here is a basic example. Requires you create a new tab named "Add" (Text as "+") in the 'TAbPages' collection first.:
    vb Code:
    1. Private Sub TabControl1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TabControl1.MouseClick
    2.         If TabControl1.SelectedTab.Name.ToString = "Add" Then Me.TabControl1.TabPages.Insert(Me.TabControl1.TabCount - 1, "NewTab" & Me.TabControl1.TabCount, "New")
    3.     End Sub

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width