Cannot implicitly convert type 'System.Windows.Forms.ContextMenuStrip'
-
Hello everyone, I ran into this error, which im not sure whats wrong. On my form1.cs, i have this code:
SyntaxHighlightingTextBox shtb; public form1 { InitializeComponent(); shtb = new SyntaxHighlightingTextBox(); shtb.ContextMenu = MyContextMenu; }
When i try to build the solution, i get the following error:Cannot implicitly convert type 'System.Windows.Forms.ContextMenuStrip' to 'System.Windows.Forms.ContextMenu'
I don't understand, i have a fully working context menu, but when i try to add that context menu inside shtb (SyntaxHighlighting RichTextBox), im getting that error. Anyone can help me figure this one out please? -
Hello everyone, I ran into this error, which im not sure whats wrong. On my form1.cs, i have this code:
SyntaxHighlightingTextBox shtb; public form1 { InitializeComponent(); shtb = new SyntaxHighlightingTextBox(); shtb.ContextMenu = MyContextMenu; }
When i try to build the solution, i get the following error:Cannot implicitly convert type 'System.Windows.Forms.ContextMenuStrip' to 'System.Windows.Forms.ContextMenu'
I don't understand, i have a fully working context menu, but when i try to add that context menu inside shtb (SyntaxHighlighting RichTextBox), im getting that error. Anyone can help me figure this one out please?Your trying to add a ContextMenuStrip when you need to be adding a ContextMenu. Either change your ContextMenuStrip to a ContextMenu or change your SyntaxHighlightingTextBox to inherit the textbox class in the .net 2.0 framework
-
Your trying to add a ContextMenuStrip when you need to be adding a ContextMenu. Either change your ContextMenuStrip to a ContextMenu or change your SyntaxHighlightingTextBox to inherit the textbox class in the .net 2.0 framework