PC Review


Reply
Thread Tools Rate Thread

Custom user control and focus problem.

 
 
Jerod
Guest
Posts: n/a
 
      5th Feb 2007
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

 
Reply With Quote
 
 
 
 
ClayB
Guest
Posts: n/a
 
      6th Feb 2007
Instead of the userControl1.GotFocus, try using the userControl1.Enter
event.

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


 
Reply With Quote
 
Stoitcho Goutsev \(100\)
Guest
Posts: n/a
 
      6th Feb 2007
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


--
Stoitcho Goutsev (100)
"Jerod" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom control focus dragonslayer008@hotmail.com Microsoft Dot NET Framework Forms 1 19th Sep 2007 02:12 PM
User Control Problem - How to Focus to the embedded Page? =?Utf-8?B?c3M=?= Microsoft ASP .NET 1 17th Nov 2005 03:25 AM
User Control Focus Problem... =?Utf-8?B?Q3JhaWcgLSBSb2Fub2tl?= Microsoft Dot NET Framework Forms 0 1st Aug 2005 09:45 PM
Custom user control in scrollable container problem Ethan S. Microsoft VB .NET 0 6th Jul 2005 06:23 AM
Custom User Control problem Mark Microsoft Dot NET 0 13th Aug 2003 11:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:03 AM.