473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Mouse Move (Mouse Over)

759 512MB
Hello !

I have a form with a ListBox (can be a ComboBox as well).
This ListBox is based on a table (or query). First column (is hidden) contain the record's IDs.

I wish to use the MouseMove event (or other event but NOT the OnClick event) in order to obtain the ID for THAT record where the cursor is (NO click in the list).

The same question for a regular form which display a record set (what ID has that record where the cursor is?).

For more (but unnecessary info):
I like to have a PictureBox (only one, in the form header or footer) where to display a .jpg file based only on the cursor position.

Hope you understand what I mean.

Thank you !
Apr 5 '13 #1

✓ answered by TheSmileyCoder

You can do it with a listVIEW (ActiveX control), but I don't think you can do it with a listBOX. I don't know of any way to get the item under the cursor, without selecting it.

4 3542
nico5038
3,080 Expert 2GB
For a combobox I used:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2.  
  3. Me.Text2 = Me.Combo0.Column(0)
  4. Me.Repaint
  5.  
  6. End Sub
  7.  
This works only when the form's timer is set to a value (I used 20).
Personally I don't like using a timer on a form, as I've experienced some side-effects, but worth a try.

The value placed in the Text2 field will be the selected value from a combobox or listbox.

Nic;o)
Apr 5 '13 #2
TheSmileyCoder
2,322 Expert Mod 2GB
You can do it with a listVIEW (ActiveX control), but I don't think you can do it with a listBOX. I don't know of any way to get the item under the cursor, without selecting it.
Apr 5 '13 #3
Mihail
759 512MB
Thank you (both of you) for answers.

Yes, Smiley, this is what I am looking for.
Thank you for the tip with ListView. I'll take a look to this control. Maybe is useful for me.

I don't select (yet) the best answer: maybe someone have a better idea.

Thank you, again, for yours time !
Apr 8 '13 #4
TheSmileyCoder
2,322 Expert Mod 2GB
If you do not want to start using a activeX control which might not be supported in later versions of Access, then you could consider using a subform. Note however that subforms are (of course) quite different in behavior then listboxes, since they require the shift of focus from one form to another, and thus triggers record updates.
Apr 8 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: suhas | last post by:
Hi, I have an MDI app that allows user to create flowcharts. User can drag flowchart objects (squares, rectangles, elipses, etc) from the toolbar and put on a form. They should be able to move...
3
by: Logan Mckinley | last post by:
I need to be able to detect mouse movement even when it is not over my application. I can get the mouse cords using MousePosition but I am not sure if there is an event that hits my program when...
1
by: Jax | last post by:
I want my application to stop a certain action when it hasn't felt a mouse move for over 10 minutes I understand I could do this by using the mousemove event of the form of my application But if my...
4
by: Sakharam Phapale | last post by:
Hi All, How to find the Toolbar Button Index in Mouse Move event on Toolbar. Thanks Regards Sakharam Phapale
5
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event...
6
by: Rob | last post by:
This is a curious problem. It seems like it should be quite easy. Of course a timer is used to determine when form should be closed, but how do you consistently reset the timer when the mouse is...
3
by: ramkishor | last post by:
How can I change the color of button on mouse move over it. help .
7
by: Michael R | last post by:
It's an interesting question, as I see it. I have a form, in which there are a few command buttons, which change color when the mouse is on top of them (On Mouse Move). Now, I want the color to be...
0
by: dr3amxstar | last post by:
Hi i have some questions that i need help with. Im using VB express 2005 edition. First is that, is there any items/component that when u click it, it will open up to the other options? does...
2
rahulephp
by: rahulephp | last post by:
I am looking for the PHP Ajax mouse move popup box. It should show a small cool looking popup window when i move mouse on "Seller" link. I saw this thing here: Move the mouse on "Sellers" (next...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.