Positioning a form relative to an object or form

w_drury
04-25-2002, 01:47 PM
Is it possible to have a form open relative to an object on another form or the form itself?

I am trying to have a form open on the Got focus event and close on the Lost focus event for a text box to give the user a description of the choices(numerical only) that go in the text box. I don't want to use a combo box since the description is not going to be included in the text box.

Thanks for any help!

ChiefRedBull
04-25-2002, 03:31 PM
By "relative" you mean position-wise right?

You can move the form via its .Top and .Left properties, also using the Screen.Top, Screen.Width.

Something like this perhaps:
Open Form
X = Form Left + TextBox Left
Y = Form Top + TextBox Top
Move Form To X and Y
You may have to use the Screen.TwipsPerPixelX and TwipsPerPixelY to convert between twips and pixels...

w_drury
04-29-2002, 08:57 AM
That worked just fine.

Thank you

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum