Nevron Forum

NcontextMenu Exeption

https://www.nevron.com/Forum/Topic4898.aspx

By Volvick Derose 1 - Monday, February 14, 2011

Try to display a context menu from the following code. It works fine, however when I choose any other skin from the pallet like "Office 2007 Blue", "Blue" or any other skin name, I get an exception. Only vista plus is working without exception

private void Form1_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
{
nContextMenu1.Show(MousePosition);
}
}

By Nevron Support - Monday, February 14, 2011

Hello Volvick,

Could you tell what is the assembly version you got and what is the exception you receive, because we were unable to reproduce the described problem?
Thanks.
By Volvick Derose 1 - Tuesday, February 15, 2011

It says runtime version v4.0.30310 and version 10.7.13.12

here is the project,

By Nevron Support - Tuesday, February 15, 2011

Hi Volvick,

Please, try to set the palette of the context menu by code not by the designer.

For example to set it to be Office 2007 Blue in the form constructor you can write the following after InitializeComponent() call in the form constructor:

nContextMenu1.Palette.Scheme = Nevron.UI.WinForm.Controls.ColorScheme.Office2007Blue;
nContextMenu1.PaletteInheritance = Nevron.UI.WinForm.Controls.PaletteInheritance.None;

When you set the palette in the designer it put the settings in resource, which may cause the problem.
Please, let us know if the problem persist.
By Volvick Derose 1 - Wednesday, February 16, 2011

works fine

thanks