Can a tab control expand/contract with the window?

M

Maury Markowitz

I have a form that I'd like to display a number of subforms inside of
using a tab control. However the form is to be displayed in a window
that can be resized, and the tab control would have to be able to
resize with it. Is there any way to do this?

Maury
 
R

Rick Brandt

Maury said:
I have a form that I'd like to display a number of subforms inside of
using a tab control. However the form is to be displayed in a window
that can be resized, and the tab control would have to be able to
resize with it. Is there any way to do this?

Maury

First realize that even when you don't have a TabControl that resizing a
form's window does not resize the form at all, only the window housing the
form changes. So first you would have to master the code to make the form
sections change size as you resize the window. Once you have that then you
can add code to resize or move objects that reside within those form
sections.

As you make the window larger your code has to resize the form sections
FIRST and then move or resize objects within the sections.

As you make the window smaller you have to reverse that order and first must
resize or move the objects on the form sections and then make the form
sections smaller.

As you can imagine if the user makes the window taller while simultaneously
making it narrower or if they make it wider while simultaneously making it
shorter, then the logic can get a bit complicated.

As for TabControls you have a similar set of rules. Before you can move or
resize objects on the TabControl when the window is made larger you first
have to make the TabControl larger and then reverse that order when the
window is made smaller.

I suggest breaking this up into discrete tasks that you tackle one at a
time.
 
P

Peter

Maury,

There are third-party form scaling solutions available that might
help:

A shareware version of a form rescaling module I wrote called
ShrinkerStretcher is available at this web site: http://www.peterssoftware.com/ss.htm

There's a form resizer at http://www.jamiessoftware.tk/resizeform/rf_jump.html
..

Another one: http://sourceforge.net/projects/modscaleform

The Access Developer's Handbook has form resizing code included:
http://www.amazon.com/exec/obidos/ISBN=0782119417/107-8064361-7403703

Hope this helps,

Peter De Baets
Peter's Software - Microsoft Access Tools for Developers
http://www.peterssoftware.com
 
M

Maury Markowitz

Thanks Peter! I'll check these out when I return to work (long
weekend, ahhh...)

Maury
 

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