How can I add an icon to a MenuItem? [duplicate] - c#

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to put an icon in a MenuItem
I would like to put a door-and-arrow icon next to an Exit menu item. Is this possible? I'm sure it is, because I've seen it in other places before.

Assuming you are using Visual Studio 2012, it should be really simple to add an icon to the menu using the designer.
Right-click on the menu-item you want to add the icon to and select Set Image.
I don't recall if this option is available in previous versions of Visual Studio, but would image there should be an easy way through the IDE to set it.

I've found an open source library called VistaMenu and it looks like just what I'm looking for. It is not custom drawn and it is inherited from the native menus.
http://wyday.com/vistamenu/

Related

Winforms custom control with Label, Combobox and button not displaying properly [duplicate]

This question already has answers here:
How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?
(6 answers)
Why do winform controls move on their own when I save the form
(1 answer)
Creating a DPI-Aware Application
(9 answers)
Closed 5 years ago.
I have been having a problem occuring to me in one of our winforms applications at work.
The problem consists of a Winforms custom control not being displayed properly at run time.
The custom control contains a label, combobox and a button. The Combobox is anchored to right,bottom,left and top. The button is anchored to right, bottom and top.
The custom control can be seen in the figure below 1.
inserting the custom control onto a form and viewing it in the visual 2017 designer works just fine:
But when i execute or debug the application the custom control is not displayed properly as can be seen in 3
Non of my coworkers are having this issue with on their workstations and i also do not have the same propblem on my computer at home.
We have tested it on multiple machines all with the same fresh checkout from our SVN repository and only my machine gets this weird error.
I fixed the error for apporximate 2 weeks ago by simply uninstalling visual studio and reinstalling it, and it worked. But now from one day to the other the problem has come again. It would be nice if anybody knew why this is happening and a possible solution other than reinstalling visual studio.

Not sure what this tool is called [duplicate]

This question already has answers here:
How to create an Explorer-like folder browser control?
(3 answers)
Closed 5 years ago.
Not sure if this is off topic or not, if it is i will gladly delete.
I am converting one of my companies utility programs to C#.NET in winforms it is written in vb6, DEFINITELY NOT .NET as it is 15 years old. and in the UI it has a tool which looks like this
it acts like a folder browser put stays on the UI unlike a folder browser dialog which is a popup. is there a .NET tool which does the same thing or do i have to use a folder browser dialog. ideally i would like to keep it on the screen because i think it looks better to keep it on the screen rather than a separate box. if anyone knows if this is actually a tool in C#.NET winforms or not that would be great
Yes these controls are no longer avaiable in .net, you can create one yourself relatively easily, here is a MSDN link describing what you want
https://msdn.microsoft.com/en-us/library/ms171645(v=vs.110).aspx

Remove 'Black Bar' From Any Window [duplicate]

This question already has answers here:
Disable Visual Studio 2015 extra debug option
(5 answers)
Closed 6 years ago.
So whenever I try and run any WPF application in Visual Studio 2015, this black box thingy appears:
Here's what the icons say:
How do I get rid of it?
Thanks.
You're looking at the UI Debugger, which lets you do similar things as Snoop, which is also an excellent tool that has saved me a lot of trouble in the past.
That being said, you have two options to disable it:
Detach the debugger, or run without debugging
See the answers in this post

How do you make a program with multiple "Pages"? [duplicate]

This question already has answers here:
Creating Wizards for Windows Forms in C#
(3 answers)
Closed 9 years ago.
How do you make something like the things where you install programs by clicking the "Next" button and it will show you like a TextBox instead of a ComboBox like on a new Panel?
Sort of like changing Tabs on a TabControl but without showing the tabs.
You are probably looking for Wizard. You may see
Simple Wizard for Winforms - CodeProject
You may also take a look at WinForms Wizard from DevExpress but its not free.

Title-bar's context menu [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I customize the system menu of a Windows Form?
How could I insert new items to the title-bar's context menu as in Google's Chrome:
I would prefer a C# WPF solution, but I have no problem to do this in C++ (Interops are all set already).
Thank you.
Some other alternatives here:
http://www.codeproject.com/Articles/70568/An-MVVM-friendly-approach-to-adding-system-menu-en
http://www.codeproject.com/Tips/320885/Customize-Window-System-Menu-in-WPF
You might consider using the 2nd link where it actually creates a WPF menu instead of modifying the existing native system menu, if you wanted to skin the menu for your application.
I'd suggest you extended the code to scan the native System Menu so you could create WPF menu items that mirrored the expected System Menu items.

Categories

Resources