PC Review


Reply
Thread Tools Rate Thread

How do I know System.Windows.Forms.TextBox in System.Windows.Forms lose Active?

 
 
Frank Lee
Guest
Posts: n/a
 
      6th May 2005
How do I know System.Windows.Forms.TextBox in System.Windows.Forms lose
Active?

I mean When a textbox get focus, then user click on another form/application
to make another form/application activate and make this form/application
deactivate, how to I know that in textbox? What event/message was sent to
textbox?

---Frank


 
Reply With Quote
 
 
 
 
Morten Wennevik
Guest
Posts: n/a
 
      6th May 2005
Hi Frank,

The TextBox will never know as strictly speaking it's none of its business. The TextBox will only be notified if it loses focus to another control in the same form. You can use the Control.Leave event for this.

If your Form loses focus (ie clicking on another application) you can detect this in the Form.Deactivated event. You can then do something with the TextBox if needed.


--
Happy coding!
Morten Wennevik [C# MVP]
 
Reply With Quote
 
Frank Lee
Guest
Posts: n/a
 
      6th May 2005

"Morten Wennevik" <(E-Mail Removed)>
???????p.sqcluwa5klbvpo@stone...
> Hi Frank,
>
> The TextBox will never know as strictly speaking it's none of its
> business. The TextBox will only be notified if it loses focus to another
> control in the same form. You can use the Control.Leave event for this.
>
> If your Form loses focus (ie clicking on another application) you can
> detect this in the Form.Deactivated event. You can then do something with
> the TextBox if needed.
>


OK, it's a way.

However, for an IE Hosted usercontrol. How can I known IE loses focus?

---Frank


 
Reply With Quote
 
Morten Wennevik
Guest
Posts: n/a
 
      6th May 2005
I'm afraid I don't know. You may want to start a new thread with this question.

On Fri, 06 May 2005 12:33:51 +0200, Frank Lee <(E-Mail Removed)> wrote:

>
> "Morten Wennevik" <(E-Mail Removed)>
> ???????p.sqcluwa5klbvpo@stone...
>> Hi Frank,
>>
>> The TextBox will never know as strictly speaking it's none of its
>> business. The TextBox will only be notified if it loses focus to another
>> control in the same form. You can use the Control.Leave event for this.
>>
>> If your Form loses focus (ie clicking on another application) you can
>> detect this in the Form.Deactivated event. You can then do something with
>> the TextBox if needed.
>>

>
> OK, it's a way.
>
> However, for an IE Hosted usercontrol. How can I known IE loses focus?
>
> ---Frank
>
>
>




--
Happy coding!
Morten Wennevik [C# MVP]
 
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
password in Windows.System.Forms.TextBox manjub Microsoft Dot NET 1 26th Oct 2006 08:46 PM
System.Windows.Forms.Form and System.Windows.Forms.RichTextBox Piotr Microsoft Dot NET 4 23rd Mar 2006 09:41 AM
how to filter out non-digit chars when user writes text to System.Windows.Forms.TextBox Ivan Microsoft C# .NET 3 23rd Sep 2005 08:06 PM
System.Windows.Forms.TextBox and Magtek Credit Card Stripe Reader =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ== Microsoft Dot NET Framework Forms 0 19th Sep 2005 05:01 PM
How to scroll a multiline System.windows.forms.textbox down to the last line through code? Rvo Microsoft VB .NET 3 3rd Aug 2004 04:05 PM


Features
 

Advertising
 

Newsgroups
 


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