Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

Custom user control and focus problem.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jerod - 05 Feb 2007 17:24 GMT
Hi all,

My situation is a bit more complex then my example here, but if I can
figure this out then the rest should fall into place. Thanks in
advance!

Example:
   MyUserControl contains a textbox.
   MyForm contains MyUserControl and a Label.

When the user navigates to the textbox I want to change the label's
text. The problem is that the textbox gets focus, the UserContol does
not get focus. I can't trap the textbox focus because is private to
the UserControl.

Does anybody know a way to capture the MyUserControls_GotFocus event?

Thanks again!
Jerod
ClayB - 06 Feb 2007 01:50 GMT
Instead of the userControl1.GotFocus, try using the userControl1.Enter
event.

===================
Clay Burch
Syncfusion, Inc.
Stoitcho Goutsev (100) - 06 Feb 2007 15:28 GMT
Jerod,

Can't you catch the focus event of the text box inside that user control and
then have the user control to fire a special even (one that you define).
This way the form can hook on this event and change the text of the label
acrodingly

Signature

Stoitcho Goutsev (100)

> Hi all,
>
[quoted text clipped - 15 lines]
> Thanks again!
> Jerod

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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



©2008 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.