Jump to content
Software FX Community

Removing/Disabling Gallery Option From Chart

User (Legacy)

Recommended Posts

Ok. To disable the Gallery from all menus, toolbars and dialogs simply do:

chart1.Style &= ~ChartStyle.Gallery;

You can remove the gallery command from the toolbar and from the context

menu by doing:

chart1.ToolBarObj.RemoveAt(6); // Remove from toolbar

chart1.Commands[(int)CommandID.ContextMenuBack].RemoveSubCommand(4); //

Remove from context menu

if you have a customizable toolbar and menus, instead of using fixed indexes

(6 and 4) you can loop through the toolbar and menu until you find


You code:

Chart1.Commands[(int)CommandID.Gallery].Enabled = false;

Doesn't work becuase built-in commands are enabled/disabled automatically

depending on context and certain conditions.

As for the exception, what I need is that you export the chart to a binary

file (using the Export method) right BEFORE you switch galleries (and get

the exception) and post it here.



Software FX

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...