473,394 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

FormBorderStyle.None and System Menu

Hi!

I have a problem. When i set FormBorderStyle property of a form to None
i can't get the system menu (that windows menu with close, maximize,
minimize and other options) to show up when i right click on the form
button in the taskbar, (i guess that's because there is no titlebar or
control button).

Is there any way to display it, or better yet can i catch the right
click on the taskbar button and display my own app menu?

Thanks!
Aug 28 '06 #1
5 10324
Salem wrote:
Hi!

I have a problem. When i set FormBorderStyle property of a form to None
i can't get the system menu (that windows menu with close, maximize,
minimize and other options) to show up when i right click on the form
button in the taskbar, (i guess that's because there is no titlebar or
control button).

Is there any way to display it, or better yet can i catch the right
click on the taskbar button and display my own app menu?

Thanks!
I forgot to mention that i use C# :)
Aug 28 '06 #2
Hi Salem,

as far as I know it's not possible show the system menu, because you
don't have a title bar in your winform.

But, there must be a way to modify the context menu. I can name you
many applications which shows a own context menu when clicking them in
taskbar.

I watch this thread because I'm interessted in that my self. Perhaps
some other guy has some more experience with that.

Wish you good luck
Cheers
Gerhard
Salem schrieb:
Salem wrote:
Hi!

I have a problem. When i set FormBorderStyle property of a form to None
i can't get the system menu (that windows menu with close, maximize,
minimize and other options) to show up when i right click on the form
button in the taskbar, (i guess that's because there is no titlebar or
control button).

Is there any way to display it, or better yet can i catch the right
click on the taskbar button and display my own app menu?

Thanks!

I forgot to mention that i use C# :)
Aug 29 '06 #3
Hi,
you can override the CreateParams property of the borderless form with
this one:

const int WS_CLIPCHILDREN = 0x2000000;
const int WS_MINIMIZEBOX = 0x20000;
const int WS_MAXIMIZEBOX = 0x10000;
const int WS_SYSMENU = 0x80000;
const int CS_DBLCLKS = 0x8;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;

cp.Style = WS_CLIPCHILDREN | WS_MINIMIZEBOX | WS_SYSMENU;
cp.ClassStyle = CS_DBLCLKS;

return cp;
}
}

Jocker
--
http://www.jockersoft.com/english/index.php

Salem wrote:
Hi!

I have a problem. When i set FormBorderStyle property of a form to None
i can't get the system menu (that windows menu with close, maximize,
minimize and other options) to show up when i right click on the form
button in the taskbar, (i guess that's because there is no titlebar or
control button).

Is there any way to display it, or better yet can i catch the right
click on the taskbar button and display my own app menu?

Thanks!
Aug 29 '06 #4
Jocker wrote:
Hi,
you can override the CreateParams property of the borderless form with
this one:

const int WS_CLIPCHILDREN = 0x2000000;
const int WS_MINIMIZEBOX = 0x20000;
const int WS_MAXIMIZEBOX = 0x10000;
const int WS_SYSMENU = 0x80000;
const int CS_DBLCLKS = 0x8;
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;

cp.Style = WS_CLIPCHILDREN | WS_MINIMIZEBOX | WS_SYSMENU;
cp.ClassStyle = CS_DBLCLKS;

return cp;
}
}
Thank you very much, that did the trick! :)

Btw, can anyone tell me which message is sent when i left click on the
taskbar button of a form so i can intercept it in WndProc?

I have only one form visible in the taskbar but i have two separate forms.

I want to display all forms when the user loses focus and clicks on the
taskbar button and i think this would be the easiest way to do it.
Aug 29 '06 #5
ge*************@googlemail.com wrote:
Hi Salem,

as far as I know it's not possible show the system menu, because you
don't have a title bar in your winform.

But, there must be a way to modify the context menu. I can name you
many applications which shows a own context menu when clicking them in
taskbar.

I watch this thread because I'm interessted in that my self. Perhaps
some other guy has some more experience with that.

Wish you good luck
Cheers
Gerhard

Hi, Jocker posted a nice example of overriding CreateParams of a forms
and that did the trick (for the system menu at least ;)).
Aug 29 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jason Rodman | last post by:
I have standard winform that I have hidden the title bar so that I can make my own custom header. I have my own code to drag the form and close/minimize/maximize and even show the title in the task...
4
by: harrylmh | last post by:
Hi, I've really been struggling with this. How do I make a form resizable with FormBorderStyle = None? I've had problems trying to get the form to start resizing by following the mouse...
2
by: Rafi Zisman | last post by:
Hi I have a problem with menu and FormBorderStyle = None: I opened new C# project and set the property FormBorderStyle = None , And added main menu. When I run the application and on the last...
4
by: trint | last post by:
Ok, I received info that this will work as a means of removing the border around a window that I create (which also loads an aspx file) in the firing file (aspx using javascript): OpenWindow =...
7
by: John Bowman | last post by:
Hi, I need to create a win form that appears on the taskbar, but is very limited in functionality. So I've set ShowInTaskbar = True & ControlBox = True. But I need to modify the system menu that...
2
by: Sharon | last post by:
In the Form there is the Control/System menu. I wish to prevent this system menu from poping-up although the minimize, maximize and close buttons is still shown on the Form caption bar. How can...
5
by: Mark Ingram | last post by:
Hi, ive got a form with FormBorderStyle set to None (i am using custom regions to determine the shape of the form). But i would like to be able to display the standard system menu when the user...
0
by: siemsje | last post by:
I've created an app in win2k with a winform using FormBorderStyle = none. With this setting, the app icon is not displayed in the button in the taskbar when the app is running. If I change the...
4
by: raj.indian.08 | last post by:
Hi all, I am trying to modify the system menu of all the applications in my machine. For example say - I am creating multiple desktops for windows - and I want to give every application the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.