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 / April 2005

Tip: Looking for answers? Try searching our database.

Minimize (and Not Maximize) options for borderless form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Jones - 07 Apr 2005 08:26 GMT
I have a borderless WIndows Form.

I've found that with a borderless form the ContextMenu for the program
button in the task-bar is turned off.  Upon advice from this list I can turn
it back on by overriding the CreateParams property like so:

       Protected Overrides ReadOnly Property CreateParams() As CreateParams
           Get
               Const WS_SYSMENU As Integer = &H80000
               Dim oReturn As CreateParams = MyBase.CreateParams
               oReturn.Style = oReturn.Style Or WS_SYSMENU
               Return oReturn
           End Get
       End Property

The problem is, I end up with only the Maximize option enabled.  I want the
reverse of this.  To be able to minimize the form, and NOT maximize it.

I'm wondering, is this a problem with the setings in "CreateParams" or is it
a setting I need to make somewhere else.

Many thanks!
===
Phil
Stoitcho Goutsev \(100\) [C# MVP] - 08 Apr 2005 03:24 GMT
Hi Phil,

You need to add one more style to the CreateParams.Style.
The new stile would be

WS_MINIMIZEBOX = 0x20000;

If you want to remove the maximize option from the menu you need to remove
the
WS_MAXIMIZEBOX  = 0x1000

C# code for that is

cp.Style &= (~WS_MAXIMIZEBOX);

Simple altering of the MaximizeBox and MinimizeBox properties of the form
won't do

Signature

Stoitcho Goutsev (100) [C# MVP]

>I have a borderless WIndows Form.
>
[quoted text clipped - 22 lines]
> ===
> Phil
Phil Jones - 08 Apr 2005 05:06 GMT
Thanks Stoitcho!

Do you know if there is a list of all avaialble params (hex values) on MSDN
anywhere?

Cheers.
===
Phil
Stoitcho Goutsev \(100\) [C# MVP] - 09 Apr 2005 00:00 GMT
Not in MSDN, though. I've seen web sites that people had listed them. I've
even seen a link to a program that a programmer in this newsgroup had made
where you can type the name of the constant and it gives you the hex value.
I guess if you google a bit you may find them.
What I presonally do is to go in the folder on my computer where VS.NET is
intalled and then go down into VC++ Platfrom SDK's 'Include' sub folder. On
my machine :
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include
Almost all constant that you may need to use are decalred in winuser.h
header file.

If you need one that is not in this file you can find the header file in the
SDK (part of MSDN) documentation (usually it is on the bottom of the page
for this constant).

Signature

Stoitcho Goutsev (100) [C# MVP]

> Thanks Stoitcho!
>
[quoted text clipped - 4 lines]
> ===
> Phil
Phil Jones - 15 Apr 2005 01:19 GMT
Thanks Stoitcho - apprecaite that info.

Rate this thread:







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.