Click here to Skip to main content
15,887,244 members
Home / Discussions / C#
   

C#

 
GeneralRe: Optional Prameter Pin
Martin#24-Aug-06 1:06
Martin#24-Aug-06 1:06 
GeneralRe: Optional Prameter [modified] Pin
Christian Graus24-Aug-06 1:11
protectorChristian Graus24-Aug-06 1:11 
GeneralRe: Optional Prameter Pin
iprasad00724-Aug-06 2:01
iprasad00724-Aug-06 2:01 
QuestionVB6 TO C# Pin
M Riaz Bashir23-Aug-06 19:39
M Riaz Bashir23-Aug-06 19:39 
AnswerRe: VB6 TO C# Pin
iprasad00723-Aug-06 20:03
iprasad00723-Aug-06 20:03 
AnswerRe: VB6 TO C# Pin
Christian Graus23-Aug-06 21:09
protectorChristian Graus23-Aug-06 21:09 
GeneralRe: VB6 TO C# Pin
iprasad00723-Aug-06 23:15
iprasad00723-Aug-06 23:15 
QuestionWhere is the focus moving to? [modified] Pin
philxan23-Aug-06 17:42
philxan23-Aug-06 17:42 
I want to be able to check which control the focus is moving to, when a particular control is losing the focus.

Bascially, I have a text box, that when you type into it displays an autocomplete list. If the focus is moving away from the text box to some other control, I want to hide the list. However, if its moving TO the list, then obviously it needs to stay shown.

There doesn't seem to be anything in the .Net events that indicate where the focus is moving. Is there perhasps a message I can send that discovers it?

Thansk in advance

phil

-- modified at 0:23 Thursday 24th August, 2006

Thanks for all your non-replies Smile | :) I seem to have found out how to do it..
The easiest way is to in the OnLostFocus event handler, to first call the base.OnLostFocus. When control returns to your code, whichever control the focus has moved to will now have its .Focused property = true.

<br />
protected override void OnLostFocus(EventArgs e)<br />
{<br />
  base.OnLostFocus (e);         // complete my losing control events<br />
  if (!autoCompleteBox.Focused) // if the focus hasn't moved to where I want it to<br />
    autoCompleteBox.Hide();<br />
}<br />


Regards,

Phil
AnswerRe: Where is the focus moving to? Pin
stancrm23-Aug-06 18:23
stancrm23-Aug-06 18:23 
AnswerRe: Where is the focus moving to? Pin
Nader Elshehabi23-Aug-06 18:38
Nader Elshehabi23-Aug-06 18:38 
GeneralRe: Where is the focus moving to? Pin
philxan23-Aug-06 19:54
philxan23-Aug-06 19:54 
QuestionLoose HTML -> XHTML.NET component Pin
Chris Maunder23-Aug-06 17:02
cofounderChris Maunder23-Aug-06 17:02 
AnswerRe: Loose HTML -&gt; XHTML.NET component Pin
Nader Elshehabi23-Aug-06 17:36
Nader Elshehabi23-Aug-06 17:36 
GeneralRe: Loose HTML -&gt; XHTML.NET component Pin
Chris Maunder23-Aug-06 17:44
cofounderChris Maunder23-Aug-06 17:44 
GeneralRe: Loose HTML -&gt; XHTML.NET component Pin
Nader Elshehabi23-Aug-06 18:53
Nader Elshehabi23-Aug-06 18:53 
GeneralRe: Loose HTML -&gt; XHTML.NET component Pin
Chris Maunder24-Aug-06 4:01
cofounderChris Maunder24-Aug-06 4:01 
GeneralRe: Loose HTML -&gt; XHTML.NET component Pin
leppie23-Aug-06 20:49
leppie23-Aug-06 20:49 
GeneralRe: Loose HTML -&gt; XHTML.NET component Pin
Insincere Dave24-Aug-06 7:05
Insincere Dave24-Aug-06 7:05 
Questioncan c# language write a code that run on linux? Pin
George_Botros23-Aug-06 14:50
George_Botros23-Aug-06 14:50 
AnswerRe: can c# language write a code that run on linux? Pin
Christian Graus23-Aug-06 14:55
protectorChristian Graus23-Aug-06 14:55 
AnswerRe: can c# language write a code that run on linux? Pin
Chris Maunder23-Aug-06 17:00
cofounderChris Maunder23-Aug-06 17:00 
QuestionHow can i access USB port in c# plz? [modified] Pin
George_Botros23-Aug-06 14:46
George_Botros23-Aug-06 14:46 
AnswerRe: How can i access usp port in c# plz? Pin
Christian Graus23-Aug-06 14:56
protectorChristian Graus23-Aug-06 14:56 
AnswerRe: How can i access USB port in c# plz? Pin
J. Dunlap23-Aug-06 15:39
J. Dunlap23-Aug-06 15:39 
QuestionBackColor to Color.Transparent makes hang Pin
likefood23-Aug-06 13:45
likefood23-Aug-06 13:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.