New form opening

mattP

Registered User.
Local time
Today, 15:12
Joined
Jun 21, 2004
Messages
87
Is there a way you can set where a from Opens in relation to a button or a piece of text you select.

Basically I have a main form, with some selectable options on the LHS of the screen, rather than use buttons I have text boxes programmed to open a form using the "On-Click" event, I want the new form to open right next to the text box, so it will look like a drop down menu.

Additionally the main form could be moved around the screen, is there a way of locking the 2nd form to be next to the text box ?

Additionally I know I could use a list to but I am trying to design the DB with a certain look.

Many thanks

MattP
 
I'm not definite on this, but I think you can set the starting position out. As far as locking it.... you can either: 1) change the form's border property (and maybe some others) or 2) change the form's "moveable" property to no

The only way I know of... that you might be able to set the position would be to use API calls and getting the handle to the window, which would require a lot of code.

Doing it this way, you'd have to open the main form with api... get that window's position and width and then set the new form's position to the right of that (or to the left if the new form will open off the monitor) using the Me.move() function.

However, if you wanted to move them yourself. In the mainform set the width of the form to a global using:screen.ActiveForm.Width
and move it where you want: screen.activeform.move()
then when your new form loads, move it to the old form's postion plus the width (you may have to convert inches to pixels though).

**in the above me.width might have to be replaced with me.windowwidth

-hope this gets you started,
modest


ps. anyone who knows an easier way.. please add
 

Users who are viewing this thread

Back
Top Bottom