Custom user control and focus problem.

J

Jerod

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
 
C

ClayB

Instead of the userControl1.GotFocus, try using the userControl1.Enter
event.

===================
Clay Burch
Syncfusion, Inc.
 
S

Stoitcho Goutsev \(100\)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top