Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

Topmost Form should never get focus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Beren - 17 Jul 2004 21:05 GMT
Hello

I'm having a form that acts as some kind of OSD layer on top of the current
active window, however when I alt tab or click it, the focus can still be
given to that form. I don't want to happen.

I've been experimenting with the focus / enter / validating events, but I
don't seem to get it working.

Can someone help me ?

Thanks in advance,

Beren.
Bob Powell [MVP] - 18 Jul 2004 14:19 GMT
Did you ensure that the "ShowInTaskbar" property is false?

Signature

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

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

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

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml

> Hello
>
[quoted text clipped - 10 lines]
>
> Beren.
Beren - 18 Jul 2004 16:31 GMT
Yes I have set the property to false, but alt tabbing still shows the form
icon in the list.

> Did you ensure that the "ShowInTaskbar" property is false?
>
[quoted text clipped - 13 lines]
> >
> > Beren.
Bob Powell [MVP] - 18 Jul 2004 19:28 GMT
Set the form border style to ToolWindow. That should fix it.

Signature

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

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

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

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml

> Yes I have set the property to false, but alt tabbing still shows the form
> icon in the list.
[quoted text clipped - 18 lines]
> > >
> > > Beren.
Bob Powell [MVP] - 18 Jul 2004 19:30 GMT
Thinking about your requirements a bit more deeply it seems to me that you
probably need a different sort of window entirely.

Consider making the window based on NativeWindow and using p/invoke to show
the window with the SW_NOACTIVATE style.

Signature

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

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

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

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml

> Hello
>
[quoted text clipped - 10 lines]
>
> Beren.
Beren - 18 Jul 2004 20:11 GMT
Hmm as you might have noticed I'm not that experienced yet...
If I make a new form class inheriting from nativewindow, how could I use the
invoke and that window message ?

Thanks for helping this clueless person

ps. the toolwindow setting solved the alt-tab issue, but then I had the
titlebar and borders ofcourse...

> Thinking about your requirements a bit more deeply it seems to me that you
> probably need a different sort of window entirely.
[quoted text clipped - 17 lines]
> >
> > Beren.
Gerrit Schunk - 18 Jul 2004 22:26 GMT
Set Form.Text = "" and Form.ControlBox = False to remove the title bar. You
still will have a small border around the form, but maybe this is OK for
you.

Gerrit

> Hmm as you might have noticed I'm not that experienced yet...
> If I make a new form class inheriting from nativewindow, how could I use the
[quoted text clipped - 29 lines]
> > >
> > > Beren.
Beren - 19 Jul 2004 17:14 GMT
Nah that looks too nasty :)

> Set Form.Text = "" and Form.ControlBox = False to remove the title bar. You
> still will have a small border around the form, but maybe this is OK for
[quoted text clipped - 41 lines]
> > > >
> > > > Beren.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.