ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Tabstrip Tabs Width (https://www.excelbanter.com/excel-programming/403818-tabstrip-tabs-width.html)

Darren Hill

Tabstrip Tabs Width
 
I'm using a Tabstrip control.
I would like to position a textbox just to the right of the rightmost
visible tab.
Since the number and width of those tabs will vary, I need a way to
figure out the current width of all visible tabs.

Is this possible?

Thanks.

Darren

Bernie Deitrick

Tabstrip Tabs Width
 
Darren,

You could force the width to be a standard by using the TabFixedWidth property. Or just put the
textbox on the userform in a consistent location. Or use the Contril Tip Text of the tab to contain
your text.

HTH,
Bernie
MS Excel MVP


"Darren Hill" wrote in message
...
I'm using a Tabstrip control.
I would like to position a textbox just to the right of the rightmost visible tab.
Since the number and width of those tabs will vary, I need a way to figure out the current width
of all visible tabs.

Is this possible?

Thanks.

Darren




Peter T

Tabstrip Tabs Width
 
Try adding all the tab captions to a hidden textbox, font same as the
tabstrip and its Autosize property true. Will also need to add a bit of
padding for each tab and deduct a bit of padding in the textbox. If you play
around should get it pretty close.
newLeft = tabstrip1.left + textbox1.width

Regards,
Peter T

"Darren Hill" wrote in message
...
I'm using a Tabstrip control.
I would like to position a textbox just to the right of the rightmost
visible tab.
Since the number and width of those tabs will vary, I need a way to
figure out the current width of all visible tabs.

Is this possible?

Thanks.

Darren




Darren Hill

Tabstrip Tabs Width
 
I've Hi, Bernie.
I've tried fiddling around with the TabFixedWidth property but I must be
doing something wrong - as all but one of my tabs vanish when I use it.
Can you give a simple example of using the tabfixedwidth ?

I can't use the Control Tip, because the text box allows data entry.

Thanks for the suggestions, though.

Darren
Bernie Deitrick wrote:
Darren,

You could force the width to be a standard by using the TabFixedWidth property. Or just put the
textbox on the userform in a consistent location. Or use the Contril Tip Text of the tab to contain
your text.

HTH,
Bernie
MS Excel MVP


"Darren Hill" wrote in message
...
I'm using a Tabstrip control.
I would like to position a textbox just to the right of the rightmost visible tab.
Since the number and width of those tabs will vary, I need a way to figure out the current width
of all visible tabs.

Is this possible?

Thanks.

Darren




Darren Hill

Tabstrip Tabs Width
 
Oh, that looks like something I can do.
Thanks for the suggestion, Peter. I'll start experimenting.

Darren

Peter T wrote:
Try adding all the tab captions to a hidden textbox, font same as the
tabstrip and its Autosize property true. Will also need to add a bit of
padding for each tab and deduct a bit of padding in the textbox. If you play
around should get it pretty close.
newLeft = tabstrip1.left + textbox1.width

Regards,
Peter T

"Darren Hill" wrote in message
...
I'm using a Tabstrip control.
I would like to position a textbox just to the right of the rightmost
visible tab.
Since the number and width of those tabs will vary, I need a way to
figure out the current width of all visible tabs.

Is this possible?

Thanks.

Darren




Bernie Deitrick

Tabstrip Tabs Width
 
Darren,

Create a new userform, insert a tab strip, and then use the code below in the userform's module.
Each click on the userform will increase the tabwidth, and a double-click will reset it. See what
happens....

HTH,
Bernie
MS Excel MVP


Private Sub UserForm_Click()
UserForm1.TabStrip1.TabFixedWidth = UserForm1.TabStrip1.TabFixedWidth + 20
End Sub

Private Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
UserForm1.TabStrip1.TabFixedWidth = 20
End Sub

Private Sub UserForm_Initialize()
Dim i As Integer
i = 1
With Me
.Width = 500
.Height = 500
With .TabStrip1
While .Tabs.Count < 5
.Tabs.Add "New tab" & i
i = i + 1
Wend
.MultiRow = True
.Width = 400
.Height = 400
.TabFixedWidth = 20
.Left = 50
.Top = 50
End With
End With
End Sub


"Darren Hill" wrote in message
...
I've Hi, Bernie.
I've tried fiddling around with the TabFixedWidth property but I must be doing something wrong -
as all but one of my tabs vanish when I use it.
Can you give a simple example of using the tabfixedwidth ?

I can't use the Control Tip, because the text box allows data entry.

Thanks for the suggestions, though.

Darren
Bernie Deitrick wrote:
Darren,

You could force the width to be a standard by using the TabFixedWidth property. Or just put the
textbox on the userform in a consistent location. Or use the Contril Tip Text of the tab to
contain your text.

HTH,
Bernie
MS Excel MVP


"Darren Hill" wrote in message
...
I'm using a Tabstrip control.
I would like to position a textbox just to the right of the rightmost visible tab.
Since the number and width of those tabs will vary, I need a way to figure out the current width
of all visible tabs.

Is this possible?

Thanks.

Darren




Darren Hill

Tabstrip Tabs Width
 
Thanks for the code.
I was a bit confused at first, since the double click seems to be a bit
sensitive on my set up. I thought I was just single clicking, which had
me examining you code to find what was causing the unpredictable return
to starting conditions. Oops :)
But I understand now. Thanks again.



Bernie Deitrick wrote:
Darren,

Create a new userform, insert a tab strip, and then use the code below in the userform's module.
Each click on the userform will increase the tabwidth, and a double-click will reset it. See what
happens....

HTH,
Bernie
MS Excel MVP


Private Sub UserForm_Click()
UserForm1.TabStrip1.TabFixedWidth = UserForm1.TabStrip1.TabFixedWidth + 20
End Sub

Private Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
UserForm1.TabStrip1.TabFixedWidth = 20
End Sub

Private Sub UserForm_Initialize()
Dim i As Integer
i = 1
With Me
.Width = 500
.Height = 500
With .TabStrip1
While .Tabs.Count < 5
.Tabs.Add "New tab" & i
i = i + 1
Wend
.MultiRow = True
.Width = 400
.Height = 400
.TabFixedWidth = 20
.Left = 50
.Top = 50
End With
End With
End Sub


"Darren Hill" wrote in message
...
I've Hi, Bernie.
I've tried fiddling around with the TabFixedWidth property but I must be doing something wrong -
as all but one of my tabs vanish when I use it.
Can you give a simple example of using the tabfixedwidth ?

I can't use the Control Tip, because the text box allows data entry.

Thanks for the suggestions, though.

Darren
Bernie Deitrick wrote:
Darren,

You could force the width to be a standard by using the TabFixedWidth property. Or just put the
textbox on the userform in a consistent location. Or use the Contril Tip Text of the tab to
contain your text.

HTH,
Bernie
MS Excel MVP


"Darren Hill" wrote in message
...
I'm using a Tabstrip control.
I would like to position a textbox just to the right of the rightmost visible tab.
Since the number and width of those tabs will vary, I need a way to figure out the current width
of all visible tabs.

Is this possible?

Thanks.

Darren




All times are GMT +1. The time now is 06:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com