|
-
Feb 5th, 2007, 07:20 AM
#1
Thread Starter
Addicted Member
[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
-
Feb 5th, 2007, 08:23 AM
#2
Thread Starter
Addicted Member
Re: Getting the width of a tab
Tis ok, Got this sorted, here's the code i used for everyone to view.
VB Code:
Dim myTabRect As Rectangle 'This is a global declaration
myTabRect = TabControl1.GetTabRect(TabControl1.TabCount - 1) 'This gets the size of the tab
'Put this inside your method..
'This gets the left hand side, and the overall width
Dim tabwidth As Integer = myTabRect.X + myTabRect.Width
'This sets the button location to the right of the current tab
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|