Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / November 2008



Tip: Looking for answers? Try searching our database.

usercontrol GotFocus/LostFocus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nico Notter - 20 Nov 2008 12:59 GMT
After puting a lot of work in a usercontrol I suddenly found
that UserControl_GotFocus and ..LostFocus won't work as
expected, probably because the other controls which are
visible get the focus and the container itself which is
completely hidden by them never gets the focus.

I tried to work around with checking GotFocus/LostFocus for
each control in the usercontrol, but that leads to some
other ugly problems (which only might be solved with a lot
of overhead code and only if all of these controls'
Got/LostFocus events would work as expected).

So is there another way to detect if no one control of a
container has the focus?
Ken Halter - 21 Nov 2008 05:14 GMT
> After puting a lot of work in a usercontrol I suddenly found that
> UserControl_GotFocus and ..LostFocus won't work as expected, probably
> because the other controls which are

See:

EnterFocus Event
http://msdn.microsoft.com/en-us/library/aa445462(VS.60).aspx

ExitFocus Event
http://msdn.microsoft.com/en-us/library/aa445463(VS.60).aspx
Nico Notter - 21 Nov 2008 10:23 GMT
Thank you and shame on me. A classic example for looking the
trees without seeing the forest.
Ralph - 21 Nov 2008 13:19 GMT
> Thank you and shame on me. A classic example for looking the
> trees without seeing the forest.

Are you saying you lost focus?
Nico Notter - 21 Nov 2008 14:43 GMT
Obviously my mental CPU was a little bit out of service - I
saw & tested GotFocus and didn't see that there is
EnterFocus, too. And this does the job very well.
Jan Hyde (VB MVP) - 21 Nov 2008 16:39 GMT
"Ralph" <nt_consulting64@yahoo.com>'s wild thoughts were
released on Fri, 21 Nov 2008 07:19:57 -0600 bearing the
following fruit:

>> Thank you and shame on me. A classic example for looking the
>> trees without seeing the forest.
>
>Are you saying you lost focus?

OMG lol

--
Jan Hyde (VB MVP)

https://mvp.support.microsoft.com/profile/Jan.Hyde
Ralph - 22 Nov 2008 01:16 GMT
My apologies to all. I just found it impossible to resist. lol

-ralph
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.