find cursor position on screen

M

Michelle K.

I need to store the current position of the pointer so that I can place
another object at that position programmatically. Any ideas?
 
D

Dale_Fye via AccessMonster.com

My recommendation would be to use the MouseUp or MouseDown event of the
section that you are in.

Private Sub Detail_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)

Me.ctrlName.Top = Y
Me.ctrlName.Left = X

End Sub

The thing you will need to watch out for is that X+width <= the width of the
form, and Y + height <= height of the form.

HTH
Dale
 
M

Michelle K.

Thanks for your response, Dale. That gives me the current top and left
position of the control within the form -- closer but not quite what I need.
I have a continuous subform in which I need to overlay the current cursor
position with another subform (to fake a combo box in only those records that
would have a combo box based on value of another field). Is there a way to
determine how many records are being displayed above the current record in a
continuous form? If I know that, I could mathematically determine the
vertical positioning based on position of the subform. Horizontal position
would always be the same so that's not an issue.

Again, thanks for responding -
Michelle K.
 
D

Dale_Fye via AccessMonster.com

Well, the form has a CurrentRecord property, which will tell you which record
you are on. So you could determine the number of records "above" it by
subtracting one.

However, I really don't understand what it is you are trying to do. You
might want to take a look at some of the stuff at www.lebans.com. Stephen
has come up with some really neat stuff for manipulating controls.

Dale

Thanks for your response, Dale. That gives me the current top and left
position of the control within the form -- closer but not quite what I need.
I have a continuous subform in which I need to overlay the current cursor
position with another subform (to fake a combo box in only those records that
would have a combo box based on value of another field). Is there a way to
determine how many records are being displayed above the current record in a
continuous form? If I know that, I could mathematically determine the
vertical positioning based on position of the subform. Horizontal position
would always be the same so that's not an issue.

Again, thanks for responding -
Michelle K.
My recommendation would be to use the MouseUp or MouseDown event of the
section that you are in.
[quoted text clipped - 15 lines]
 
M

Michelle K.

Again I thank you! I hadn't looked at the CurrentRecord property. That is
the final piece of my puzzle. I think that I will go look at www.lebans.com
anyway -- there's probably a 'more correct' way to do this.

Michelle K.

Dale_Fye via AccessMonster.com said:
Well, the form has a CurrentRecord property, which will tell you which record
you are on. So you could determine the number of records "above" it by
subtracting one.

However, I really don't understand what it is you are trying to do. You
might want to take a look at some of the stuff at www.lebans.com. Stephen
has come up with some really neat stuff for manipulating controls.

Dale

Thanks for your response, Dale. That gives me the current top and left
position of the control within the form -- closer but not quite what I need.
I have a continuous subform in which I need to overlay the current cursor
position with another subform (to fake a combo box in only those records that
would have a combo box based on value of another field). Is there a way to
determine how many records are being displayed above the current record in a
continuous form? If I know that, I could mathematically determine the
vertical positioning based on position of the subform. Horizontal position
would always be the same so that's not an issue.

Again, thanks for responding -
Michelle K.
My recommendation would be to use the MouseUp or MouseDown event of the
section that you are in.
[quoted text clipped - 15 lines]
I need to store the current position of the pointer so that I can place
another object at that position programmatically. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top