Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouse/keyboard event

Status
Not open for further replies.

shabnam

Programmer
Oct 3, 2000
26
0
0
US
I have an MDI application with a status bar that shows a timed error message (using the timer control).
I want the error message to be shown till a mouse/keyboard event or till the timer event whichever is longer.
Since the user can click on a child window - the MDI form does not always get the mouse event. Is there anyway to capture the fact that the MDI application has received a mouse or a keyboard event?
 

You will have to put the code in each child that may be visable and set each key preview to true then use each forms keypress event.

Good Luck

 
Thanks - using keypreview and keypress works for the keyboard events - but does not work for the mouse. How can I capture the mouse click events for the entire application?
 

Either mousedown or mouseup for the form, but I would not suggest mousemove if you are looking for a click.

Good Luck

 
It does not execute the code in mousedown or mouseup when I click on the some control in the form. Is KeyPreview supposed to capture mouse events too? Its help only talks about the keyboard events
 

No, What you would have to do is for each form, for each control use the mousedown event.

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top