I have a simple context menu. And I would like to add to it a title element that cannot be selected, not even highlighted by the mouse cursor. When I set Enabled = false; , I can still mark it, and it seems stupid because it is clearly disabled and the text is gray.
Example:Like it. I cannot mark or select the menu item. It should never be blue. So I want this in my C # application. Simple, without styles.

Test code: public Form1() { ContextMenuStrip = new ContextMenuStrip(); ContextMenuStrip.Font = new Font("Arial", 8); ToolStripItem a = ContextMenuStrip.Items.Add("--- Title ---"); a.Enabled = false; a.Font = new Font("Consolas", 16, FontStyle.Bold | FontStyle.Italic); ContextMenuStrip.Items.Add("Alice"); ContextMenuStrip.Items.Add("Bob"); ContextMenuStrip.Items.Add("Conrad"); }
Bitterblue
source share