Tab control questions

X

XP

Using Office 2003 and Windows XP;

When using a tab control:

1) Does it wrap automatically so that the tabs are more than one layer deep
if additional tabs are inserted?

2) Is there a way to control when the tabs wrap to a second row or where the
break will occur or is this just automatic (i.e. whenever it runs out of
room)?

3) I'm sure I won't get anywhere near it, but what is the limit on the
number of tabs?

Thanks in advance.
 
M

Minton M

Using Office 2003 and Windows XP;

When using a tab control:

1) Does it wrap automatically so that the tabs are more than one layer deep
if additional tabs are inserted?

2) Is there a way to control when the tabs wrap to a second row or where the
break will occur or is this just automatic (i.e. whenever it runs out of
room)?

3) I'm sure I won't get anywhere near it, but what is the limit on the
number of tabs?

Thanks in advance.

Access shows scroll arrows on the right side of the listbox when the
number of tabs exceeds the display size - it doesn't wrap. I don't
believe there's any similar non-API-acrobatically-intensive way to do
(2) above. As for the limit, it's generally a poor design choice if
you need to have loads of tabs and will likely result in disastrous
performance due to the way the tab control acts as a container for
objects on each page.

I tested the numerical limit using:

Public Sub test()

Dim i As Integer
Dim frm As Form
Set frm = Forms("Form1")


Do
i = i + 1
frm.TabCtl0.Pages.Add
Debug.Print i
Loop

End Sub


.... and it started to slow down (adding one page a second) at around
160 tabs. FYI, you can only tab pages in design view.

Hope this helps,
James
 
M

Minton M

Access shows scroll arrows on the right side of the listbox when the
number of tabs exceeds the display size - it doesn't wrap. I don't
believe there's any similar non-API-acrobatically-intensive way to do
(2) above. As for the limit, it's generally a poor design choice if
you need to have loads of tabs and will likely result in disastrous
performance due to the way the tab control acts as a container for
objects on each page.

I tested the numerical limit using:

Public Sub test()

Dim i As Integer
Dim frm As Form
Set frm = Forms("Form1")

Do
i = i + 1
frm.TabCtl0.Pages.Add
Debug.Print i
Loop

End Sub

... and it started to slow down (adding one page a second) at around
160 tabs. FYI, you can only tab pages in design view.

Hope this helps,
James

By the way... it blew up horribly at around 290 tabs.
 
D

Dale Fye

Actually, you can display multiple rows of tabs by setting the Multi-Row
property on the Format tab to Yes.

You can also determine how many tabs will show up on a given row of tabs by
setting the tab controls TabFixedWidth property.

I generally keep it down to under a dozen tabs, and there are some
techniques for avoiding the overhead that James mentions also. One of these
is to use subforms on each of the tabs, and set the subforms sourceObject to
"" for all the tabs when the form loads or goes to a new record. Then, in
the tab controls Change event, set the subforms SourceObject to the
appropriate form if it is blank. This way, when the form loads or goes to a
new record, there is not a lot of overhead loading the subforms.

HTH
Dale
--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
M

Minton M

Actually, you can display multiple rows of tabs by setting the Multi-Row
property on the Format tab to Yes.

You can also determine how many tabs will show up on a given row of tabs by
setting the tab controls TabFixedWidth property.

I generally keep it down to under a dozen tabs, and there are some
techniques for avoiding the overhead that James mentions also. One of these
is to use subforms on each of the tabs, and set the subforms sourceObject to
"" for all the tabs when the form loads or goes to a new record. Then, in
the tab controls Change event, set the subforms SourceObject to the
appropriate form if it is blank. This way, when the form loads or goes to a
new record, there is not a lot of overhead loading the subforms.

HTH
Dale
--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

Dale you are completely right... not enough coffee today. :)
Excellent tip on the sourceobject, too...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top