Results 1 to 2 of 2

Thread: [RESOLVED] Getting the width of a tab

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    London, England
    Posts
    142

    Resolved [RESOLVED] Getting the width of a tab

    Hey folks, I'm working on a IE Clone, and i've added tabs, what i'd like to do now, is add a button beside each new tab, that represents, an open tab button. But i can't figure out how to get the width of the tabs text area. When a new tab is open, its width is determined by the length of the text in the url. Is there anyway to get the size of it, and put a button beside the last opened tab?

    Redmo
    The universal aptitude for ineptitude makes any human accomplishment an incredible miracle -Col. John P. Stapp


    Please rate the posts that have helped. Makes us feel all warm and fuzzy

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Location
    London, England
    Posts
    142

    Re: Getting the width of a tab

    Tis ok, Got this sorted, here's the code i used for everyone to view.

    VB Code:
    1. Dim myTabRect As Rectangle 'This is a global declaration
    2.  
    3. myTabRect = TabControl1.GetTabRect(TabControl1.TabCount - 1) 'This gets the size of the tab
    4.  
    5. 'Put this inside your method..
    6. 'This gets the left hand side, and the overall width
    7.         Dim tabwidth As Integer = myTabRect.X + myTabRect.Width
    8.  
    9.         'This sets the button location to the right of the current tab
    10.         BtnAddTab.SetBounds(tabwidth, 2, BtnAddTab.Width, BtnAddTab.Height)

    Redmo
    The universal aptitude for ineptitude makes any human accomplishment an incredible miracle -Col. John P. Stapp


    Please rate the posts that have helped. Makes us feel all warm and fuzzy

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