473,322 Members | 1,496 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,322 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 10315
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.