floating window problem

  • Thread starter Thread starter Lloyd Dupont
  • Start date Start date
L

Lloyd Dupont

I'm trying to create a floating window, a bit like the ComboBox drop panel.
I'm using borderless window, owner set to the FindForm() of the control
And that woks not too bad except for one thing.

When a ComboBox is poped-up the main form is stil activated (and the tool
bar active).

When my popup is show it becames active and the main form lose its active
status.

How do I fix that?
(while still allowing the user to use the control inside my popup form)
 
You need to use a little bit of interop and show the popup window using the
SW_SHOWNOACTIVATE setting.


--
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.
 
Thanks Bob, it ... partially works!
It's not shown activate.
However I us it as a 'data picker'. Let's say a color picker.
And when the user click on a color it deactivate the main form.

In the case of a color picker I could hide it straight away but in my case I
cannot .. :-/
Any other hindsight?

--
There are 10 kinds of people in this world. Those who understand binary and
those who don't.
Bob Powell said:
You need to use a little bit of interop and show the popup window using
the SW_SHOWNOACTIVATE setting.


--
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.
 
I mean a simple ComboBox works beautifully.
You could even scroll the popul panel and your main focus stay activated.

BTW how do they know when to hide the popup panel of the combobox?

--
There are 10 kinds of people in this world. Those who understand binary and
those who don't.
Bob Powell said:
You need to use a little bit of interop and show the popup window using
the SW_SHOWNOACTIVATE setting.


--
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.
 
I don't mean a ComboBox solve my problem, I mean I want to reproduce the
functionality:
to be able to click and drag (and hang over the form's border) while keeping
the main form active (even though I click on this popup form)
 
Back
Top