Exception when Calling the Editor at runtime
Posted: Wed May 31, 2006 3:38 pm
Hello,
On a base form I have put an Editor:
On inherited Forms I want to assign the Editor when a contextMenu is popped up which I do by writing:
then when the context menu item is clicked I want to show the editor. I try this:
But I get the following exception:
I use VS2003.
thanks.
On a base form I have put an Editor:
Code: Select all
private Steema.TeeChart.Editor editor1;
Code: Select all
private void contextMenuChart_Popup(object sender, System.EventArgs e)
{
m_ContextChart = (Steema.TeeChart.TChart) ((System.Windows.Forms.ContextMenu) sender).SourceControl;
}
Code: Select all
editor1.Chart = m_ContextChart;
editor1.ShowModal();
Can anyone help please?Object reference not set to an instance of an object.
Stack Trace: at Steema.TeeChart.Editors.ChartEditor..ctor(Chart c)
at Steema.TeeChart.Editor.ShowModal(Control owner)
at Steema.TeeChart.Editor.ShowModal()
at SWS_Data_Enhancer.Forms.FormChildStd.mnuChartEditor_Click(Object sender, EventArgs e) in c:\dev\c#\client apps\sws data enhancer\forms\formchildstd.cs:line 177
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Command.DispatchID(Int32 id)
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
I use VS2003.
thanks.