Tab control & positioning

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a form and placed a tab control on it. To size it, I have
placed this code in the 'Form_Open' sub.

--------------------
Private Sub Form_Open(Cancel As Integer)
myTab.Height = WindowHeight - myTab.Top
myTab.Width = WindowWidth
End Sub
--------------------

In design mode I try to place it at 'Top = 1 cm', but it doesn't work.
Whatever value I type into the 'Top' property, it chages back to the old
value as soon as I press the 'Enter' or 'Tab' button. Why is that?

Another problem is that changing the top property using VBA does not work
either. This problem seem to occur only when I have scrollbars disabled. When
they are enabled the tab control is placed at an offset to the top of the
form, but I need to scroll up to see it.

Can someone make sense out of this?
 
IIRC, you need to use TWIPS in code, not cm.

1 inch = 1440 twips

by definition so:

1 cm = 567 twips
 
About the first problem. I made a mistake not to restart Access and try
again. When I did this, it worked. Sorry about that.

But the second problem still remain. The fact that twips is used is what I
can see no reason for the code not to work.
 
The problem with the positioning of the tab control seems to appear when the
tab controls lower edge is below the forms lower edge. But why does this
happen when I have the line below in my code?
 
It's been some time since I used any of these properties, but from memory I
think WindowHeight may include the form's borders and title bar. Try
InsideHeight instead.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top