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

C#

 
QuestionSwitching .Net version in Visual Studio Pin
redkite9-Feb-06 4:16
redkite9-Feb-06 4:16 
AnswerRe: Switching .Net version in Visual Studio Pin
Judah Gabriel Himango9-Feb-06 5:17
sponsorJudah Gabriel Himango9-Feb-06 5:17 
QuestionShared Methods? Pin
csmod9-Feb-06 3:59
csmod9-Feb-06 3:59 
AnswerRe: Shared Methods? Pin
Judah Gabriel Himango9-Feb-06 5:18
sponsorJudah Gabriel Himango9-Feb-06 5:18 
GeneralRe: Shared Methods? Pin
Guffa9-Feb-06 5:56
Guffa9-Feb-06 5:56 
QuestionConvert file extension to mime type Pin
Uwe Keim9-Feb-06 3:48
sitebuilderUwe Keim9-Feb-06 3:48 
QuestionC# TreeView Pin
2dS9-Feb-06 3:45
2dS9-Feb-06 3:45 
AnswerRe: C# TreeView Pin
Andy Moore9-Feb-06 5:28
Andy Moore9-Feb-06 5:28 
Well if you want the selection to stay the same and appear selected even when the TreeView does not have focus you can write your own ShowSelectAlways property using the Win32 API SetWindowLong function like this


private bool mShowSelectAlways;
   public bool ShowSelectAlways
   {
       get
       {
           return (mShowSelectAlways);
       }
       set
       {
           mShowSelectAlways=value;
           if(value == true)
           {
               int style = GetWindowLong(this.Handle, GWL_STYLE);
               style |= TVS_SHOWSELALWAYS;
               SetWindowLong(this.Handle, GWL_STYLE, style);
           }
           else
           {
               int style = GetWindowLong(this.Handle, GWL_STYLE);
               style &= TVS_SHOWSELALWAYS;
               SetWindowLong(this.Handle, GWL_STYLE, style);
           }
       }
   }


If you want to change the selected node each time the TreeView receives focus then just handle the OnFocus event and make your node selection.

I hope this helps.

Andy

Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
GeneralRe: C# TreeView Pin
2dS9-Feb-06 20:09
2dS9-Feb-06 20:09 
QuestionHow to open large database? Pin
Pius__X9-Feb-06 3:10
Pius__X9-Feb-06 3:10 
AnswerRe: How to open large database? Pin
Colin Angus Mackay9-Feb-06 3:26
Colin Angus Mackay9-Feb-06 3:26 
AnswerRe: How to open large database? Pin
Le centriste9-Feb-06 4:20
Le centriste9-Feb-06 4:20 
AnswerRe: How to open large database? Pin
emran8349-Feb-06 10:26
emran8349-Feb-06 10:26 
QuestionWizard; Hiding a WizardStep Pin
ZeedijkMike9-Feb-06 3:00
ZeedijkMike9-Feb-06 3:00 
Questionabout axwebbrowser Pin
smr859-Feb-06 2:40
smr859-Feb-06 2:40 
Questiontext box & GO button Pin
Kola Sokol9-Feb-06 1:43
Kola Sokol9-Feb-06 1:43 
AnswerRe: text box & GO button Pin
Judah Gabriel Himango9-Feb-06 5:27
sponsorJudah Gabriel Himango9-Feb-06 5:27 
GeneralRe: text box & GO button Pin
Kola Sokol9-Feb-06 7:36
Kola Sokol9-Feb-06 7:36 
GeneralRe: text box & GO button Pin
Kola Sokol9-Feb-06 8:08
Kola Sokol9-Feb-06 8:08 
QuestionReflection -VectorClass :System.IO.FileNotFoundException Pin
sasire189-Feb-06 1:34
sasire189-Feb-06 1:34 
Question!= Operator Cant be applied Error Pin
emran8349-Feb-06 1:01
emran8349-Feb-06 1:01 
AnswerRe: != Operator Cant be applied Error Pin
Le centriste9-Feb-06 1:38
Le centriste9-Feb-06 1:38 
GeneralRe: != Operator Cant be applied Error Pin
emran8349-Feb-06 2:05
emran8349-Feb-06 2:05 
GeneralRe: != Operator Cant be applied Error Pin
Le centriste9-Feb-06 2:08
Le centriste9-Feb-06 2:08 
QuestionResource files Pin
AB77719-Feb-06 0:55
AB77719-Feb-06 0:55 

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.