Some Windows native applications have a question mark icon on the title bar. It's usually at the right edge, just near the close button. How can I do this in a C# WinForms application? I'd like a solution that works in Windows XP onward.
Set the form's HelpButton property to True. You also need to have the MaximizeButton and MinimizeButton properties set to False.
Related
I'm making a desktop mascot with unity, and I do not want to see the icon appearing on the task bar, I want the icon in the system tray. Is there a way to do this?
PS: This is NOT a windows form (it's a game), so I believe Form.ShowInTaskbar will not work.
I've never programmed in Unity, but I'm assuming you are working in a Windows window. If you make the top level window for the application not appear in the main area of the Taskbar, make the window a "Tool Window" (by setting the WS_EX_TOOLWINDOW extended style on the window), then the window/app will not show up on the taskbar.
I'll leave it to someone how knows enough Unity to tell you how to set that style. Here's a reference to start with (on the Windows side, not the Unity side): Managing Taskbar Buttons
I have assigned an icon to my application from the Properties window in Solution Explorer in Visual Studio; the application's icon changed successfully but the title bar is still showing the default icon:
I've rebuilt my application but it still displays the default icon. What am I doing wrong?
Because forms have a different icaon configuration than the application. Set the icon on the form, not ONLY on the application.
There is another reason why the icon might not show.
If the ControlBox property of the Form is set to False the icon will not show.
(Sounds like an undesired side effect)
I know that it is a very old issue but I can add the following comment :
Pay attention to the 'FormBorderStyle' property.
If 'FixedToolWindow' or 'SizableToolWindow' are selected, your icon will not appear, even if you specified an icon in the 'Icon' property.
I encountered the same issue.
Good luck.
The form itself has an Icon property you need to set as well.
If you using winform you need to set the icon property of your main form
You didn't mention if you are using winforms or wpf - wpf will place the icon on all windows/forms unless overridden.
Winforms requires individually set icons.
With the Weifen Luo DockPanel component, one can add to their .net project the ability to dock forms within other forms. The component is very well done.
Now, I see from this page at the project forum at github (where this component is now hosted), that it is possible, through the use of this dock.extender to allow the floating windows to have a normal winform look, that is, sizeable with regular Windows title bar, maximize box, minimize box, etc (see here, too). This also allows for the form's icon to show.
My problem is, and hence my question, is that the icon I assign in the form's properties will show in the designer, but one it runs in debug as a float-panel, a generic form icons appears in its place.
Now, I tried assigning the icon through code (both in the form's own code, and in the main application code too, where the form is called) rather than through properties, and that didn't work either.
So how do I get my own custom icon to show as the form's icon when the form is floated, and the extender is used? I am using the main docking panel in DockingWindow mode.
[EDIT]
I think this is a hard question! It's been 2 days and I've not gotten any answers!
This requires a change to the the FloatWindow class itself to set and update the Icon property internally as the content changes.
I have just checked the change in and it will be included in the 2.7 release of the library.
https://github.com/dockpanelsuite/dockpanelsuite/issues/35
Am making my own taskbar that will appear on top of other windows. how do I make it push other windows down such that when maximised they don't overlap my taskbar
See this question. In short, don't use Window.Topmost, as this will put your window above all other windows, which is just rude! Instead, set the "Owner" property of the other windows to be the window that you appear on top.
I am trying to add a help '?' button to the title bar (along with minimize, maximize, and close buttons) of my winforms application (C#.NET 2.0). I have tried using the Help Button property of Form, but it does not work. Any suggestions?
The Help icon is only there when HelpButton = True and MaximizeBox and MimizeBox are both set to False. This is the windows standard. If you really want to go beyond and add a button anyway, you'll have to customize the titlebar.
This is not an easy task, it either involves many hooks, or a complete redesign of the title bar.
Are you sure you want to depart from the Windows standard? Wouldn't it be better to have Help available in the menu or on a toolbar somewhere?
In addition to the solution you must change FormBorderStyle to FixedDialog. To benefit help functionality use _HelpButtonClicked event in form.