Results 1 to 4 of 4

Thread: extended TabControl

  1. #1

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    extended TabControl

    Last edited by .paul.; May 16th, 2022 at 07:35 PM.

  2. #2
    Frenzied Member jdc20181's Avatar
    Join Date
    Oct 2015
    Location
    Indiana
    Posts
    1,168

    Re: extended TabControl

    Add this
    Code:
         If MyBase.TabPages.Count = 0 Then Me.FindForm.Close()
    To this section:

    Code:
       Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) 
            If m.Msg = WM_MOUSEDOWN Then 
                If onCloseButton AndAlso Not Me.DesignMode Then 
                    MyBase.TabPages.Remove(MyBase.TabPages(HotTabIndex)) 
    
        'add the code above here'
                    m.Msg = WM_NULL 
                End If 
            End If 
            MyBase.WndProc(m) 
        End Sub
    I had this question a couple weeks ago I have a browser project I may need your help to sort through your code cause I have my own tab control but idk how to do the "+" button that would be interesting, maybe you could show me how to add just that?


    Thanks

    Jdc

    p.s. all the code does is close the form when the last tab is closed so you don't get a empty tab control/window
    Disclaimer: When code is given for example - it is merely a example.




    Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.

  3. #3

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: extended TabControl

    I remember. It was me that helped you with your code.
    If you want to see how to add an Add button, read through the code, it's commented. The Add button index is tabpages.count and is drawn in a similar fashion to the regular tabs...

  4. #4
    Frenzied Member jdc20181's Avatar
    Join Date
    Oct 2015
    Location
    Indiana
    Posts
    1,168

    Re: extended TabControl

    Quote Originally Posted by .paul. View Post
    I remember. It was me that helped you with your code.
    If you want to see how to add an Add button, read through the code, it's commented. The Add button index is tabpages.count and is drawn in a similar fashion to the regular tabs...
    I couldnt remember who helped xD But def add what I suggested (from your suggestion lol) I will read through it and see what i can find thanks

    btw, +1 on this code bank addition it took me 3 months to hunt down a custom tab control, i had asked here previously with no luck so thanks much!
    Disclaimer: When code is given for example - it is merely a example.




    Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.

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