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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Usercontrol inactive on first click

Status
Not open for further replies.

simonkue

MIS
Jul 9, 2002
105
GB
I've created a user control that is now one of many standard controls on a form. It functions OK once it has focus but I have to click on it (with no action taking place) for it to get focus. I've tried to set focus based on mouseenter, gotfocus, enter (control events) but these events are not reliable in firing every time the mouse enters the control. I also tested for mouseleave as well and this fires after mouseenter is raised even though the mouse doesn't actually leave the control!
There must be a way to get the control to do something without the first wasted click! I'm guessing I've missed something fundamental.
Any ideas please?
 
Problem solved.
Inside the user control I have a picture control that is used to show/hide a list view. I changed the use of mousedown to click and this event was picked up without the user control having focus.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top