General discussion

Locked

Acc97 - Moving current screen in runtime

By timfox ·
I am trying to move a pop-up calendar form to a position on the screen that is relative to a user's mouse click (close to the text box where the date selected will be going).

The mouse_up gives me the X,Y mouse pos in twips (although in onLine Help it says both inches/cm and twips), which I then use with the DoCmd.MoveSize method. The actual form moves slightly, although rather unpredictably.

Is anyone able to use this method with more success? Any solutions?

I've tried applying the MoveSize method with the calling form and also setting a global variable and letting the Calendar form do the movesize. I've used different combinations of events etc - without much luck.

Are there any other ways of achieving this?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Acc97 - Moving current screen in runtime

by kees.valkenswaard In reply to Acc97 - Moving current sc ...

This is not a complete answer yet!
You explained in Q
http://www.techrepublic.com/forumqa/thread_detail.jhtml?thread_id=92892
that you determined the position of the mouse. However, what you did there gives the mouse position relative to the lefttop corner of the form and not of the screen [if not maximised]
So that is probably why you get the funny movements of the (other) form. This as MoveSize results in a move relative to the original position.

I would have to check myself. I believe that you should store somewhere the current place of the calendar object. If that would be possible I would connect the calendar popup to e.g. double-clicking in the text box where you want the date. It is possible to determine the place of the textbox within the form. Thus by remembering where your calendar is you can move it to the right place by the MoveSize method of the DoCmd. A snack might be to know where the object originally is. By the way there are 567 tips in one cm!
Good luck
PS As I had a subscription to this question TechRepublic informed me that you had added a comment. Good trick.

Collapse -

Acc97 - Moving current screen in runtime

by timfox In reply to Acc97 - Moving current sc ...

Sorry Kees - I hate closing questions without giving points away - but I found it difficult to understand your suggestion (thanks anyway).

Collapse -

Acc97 - Moving current screen in runtime

by timfox In reply to Acc97 - Moving current sc ...

Thanks Kees. I'm currently evaluating all the mouse position and form moving techniques before attempting this again. May take a little time because it certainly isn't urgent. I'll let you know how I go (through TR). I haven't looked at all VB and Windows calls yet, so I have some msdn fun ahead (!).

Collapse -

Acc97 - Moving current screen in runtime

by timfox In reply to Acc97 - Moving current sc ...

I found my answer (which by the way works really well) from teh 'Dev Ashish' site the following:

http://www.mvps.org/access/forms/frm0042.htm

So, I can now open the calendar control at the exact point that a mouse is clicked.

Collapse -

Acc97 - Moving current screen in runtime

by timfox In reply to Acc97 - Moving current sc ...

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums