Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Top Properties in VBA 3

Status
Not open for further replies.

monika102001

Programmer
Sep 25, 2005
26
US
how can I change top property for text or label in VBA;depends on criteria
I tried:
If text1.Value > 0 Then
Text2.Top = 0.7396
Else
Text2.Top = 1.3958
End IF

It does not work!
Can anybody help me what I'm doing wrong!!!
 
The Top property is an Integer (no fractional part), it's a number of twips.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
So if yyou just modify your code to multiply the inches by 1440, you'll have your code working.

For Example: Text2.Top = 0.7396*1440

You may also need to refresh the screen.

 
monika102001

combining PHV's enlightful statement and boch's example you should use:

Text2.Top = Int(0.7396*1440)

for moving the control in inches expressed in twips ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top