472,783 Members | 956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 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 10285
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.