Home All Groups Group Topic Archive Search About
Author
11 Oct 2005 2:24 AM
Lloyd Dupont
I want to create some "inspector/tool windows" in my WinForm/Desktop
application.
Ideally I would like to hide them when the main form is not active.
The problem is: I can't use the deactivate event because the toll window,
when it is shown/activate deactivate the main form.
So clicking on it will hide it :S

So, how does one do that?
Ideally I would like to track if the whole application is active (or not)
and the order in which the windows are.
So I could determine the right target windows. (I would like to have only 1
inspector/tool window, but multiple document windows/forms)




--
There are 10 kinds of people in this world. Those who understand binary and
those who don't.

Author
11 Oct 2005 6:05 AM
Bob Powell [MVP]
Use p/invoke and the ShowWindow API with the SW_SHOWNOACTIVATE setting.

You can show and hide the window as your main form is shown or hidden.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





Show quote
"Lloyd Dupont" <l*@NewsAccount.galador.net> wrote in message
news:OWbD5rgzFHA.2932@TK2MSFTNGP10.phx.gbl...
>I want to create some "inspector/tool windows" in my WinForm/Desktop
>application.
> Ideally I would like to hide them when the main form is not active.
> The problem is: I can't use the deactivate event because the toll window,
> when it is shown/activate deactivate the main form.
> So clicking on it will hide it :S
>
> So, how does one do that?
> Ideally I would like to track if the whole application is active (or not)
> and the order in which the windows are.
> So I could determine the right target windows. (I would like to have only
> 1 inspector/tool window, but multiple document windows/forms)
>
>
>
>
> --
> There are 10 kinds of people in this world. Those who understand binary
> and those who don't.
>
Author
12 Oct 2005 12:58 AM
Lloyd Dupont
thanks Bob, I'll try but I'm not convinced.
because when you click on the inspector (I mean it's here to be used), I
think it will activate the window, IIRC.

Anyway someone else suggested me WM_APPACTIVATE (or something like that),
looks promising..

Show quote
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:ue%23lNkizFHA.2932@TK2MSFTNGP10.phx.gbl...
> Use p/invoke and the ShowWindow API with the SW_SHOWNOACTIVATE setting.
>
> You can show and hide the window as your main form is shown or hidden.
>
> --
> Bob Powell [MVP]
> Visual C#, System.Drawing
>
> Ramuseco Limited .NET consulting
> http://www.ramuseco.com
>
> Find great Windows Forms articles in Windows Forms Tips and Tricks
> http://www.bobpowell.net/tipstricks.htm
>
> Answer those GDI+ questions with the GDI+ FAQ
> http://www.bobpowell.net/faqmain.htm
>
> All new articles provide code in C# and VB.NET.
> Subscribe to the RSS feeds provided and never miss a new article.
>
>
>
>
>
> "Lloyd Dupont" <l*@NewsAccount.galador.net> wrote in message
> news:OWbD5rgzFHA.2932@TK2MSFTNGP10.phx.gbl...
>>I want to create some "inspector/tool windows" in my WinForm/Desktop
>>application.
>> Ideally I would like to hide them when the main form is not active.
>> The problem is: I can't use the deactivate event because the toll window,
>> when it is shown/activate deactivate the main form.
>> So clicking on it will hide it :S
>>
>> So, how does one do that?
>> Ideally I would like to track if the whole application is active (or not)
>> and the order in which the windows are.
>> So I could determine the right target windows. (I would like to have only
>> 1 inspector/tool window, but multiple document windows/forms)
>>
>>
>>
>>
>> --
>> There are 10 kinds of people in this world. Those who understand binary
>> and those who don't.
>>
>
>
Author
12 Oct 2005 2:28 AM
Nick Z.
I think in a situation like that a better approach will be to have the
tool window 'watch' if a main window is activated and then show itself.

However, when the 'main window' is deactivated, check the type of the
newly activated window, if the newly activated window is NOT another
window of a 'main window' OR 'tool window' type, then hide the tool window.

Hope this helps,
Nick Z.

Lloyd Dupont wrote:
Show quote
> I want to create some "inspector/tool windows" in my WinForm/Desktop
> application.
> Ideally I would like to hide them when the main form is not active.
> The problem is: I can't use the deactivate event because the toll window,
> when it is shown/activate deactivate the main form.
> So clicking on it will hide it :S
>
> So, how does one do that?
> Ideally I would like to track if the whole application is active (or not)
> and the order in which the windows are.
> So I could determine the right target windows. (I would like to have only 1
> inspector/tool window, but multiple document windows/forms)
>
>
>
>

AddThis Social Bookmark Button