Showing form without activation...

  • Thread starter Thread starter sandy_pt_in
  • Start date Start date
S

sandy_pt_in

Hi,
I have modal form which I am showing with some fading effect...
(it is like balloon that comes when you receive a mail in the outlook.)
But when I show this form, Owner form looses focus.
I searched across net & I came across ShowWindow API, It seems working
for me ... but the fading effect is not working.Can you please suggest
me some way so that I will be able to show my modal form using
ShowDialog and Still it is deactivated when it is loaded... please
help...
 
The only way I can think of to do this would be to make this a top-most
form (the TopMost property on the Form class). This way, you can show your
form, but have it be on top of your original form (and not have it be pushed
further down in the z-order when it looses focus).

The only problem is you might get a flicker, in the sense that you have
to activate the top form, then switch the focus back to the form below the
top form.

Hope this helps.
 
thanks Nicholas for quick reply,
I have already set TopMost property as true but it is of no use...
 
Your application needs to be deriving the notification window from
NativeWindow. This will be a top level window using a popup style and will
animate itself using the LayeredWindow API. You can use the ShowWindow API
with the SHW_SHOWNOACTIVATE style so that it doesn't grab the focus. This is
how tooltips operate.

--
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.
 
Bob said:
Your application needs to be deriving the notification window from
NativeWindow. This will be a top level window using a popup style and will
animate itself using the LayeredWindow API. You can use the ShowWindow API
with the SHW_SHOWNOACTIVATE style so that it doesn't grab the focus. This is
how tooltips operate.

--
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, Its working ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top