when the code run to " ultraToolbarsManager1.Ribbon.ApplicationMenu2010.DropDown(); "
get the NullReferenceException ,the details are:
System.NullReferenceException was unhandled by user code Message=Object reference not set to an instance of an object. Source=Infragistics2.Win.UltraWinToolbars.v10.3 StackTrace: at Infragistics.Win.UltraWinToolbars.BackStageMenuAgent.GetElementRectRelativeToContainer(UIElement element, Control container) at Infragistics.Win.UltraWinToolbars.BackStageMenuAgent.CalculateRequiredDropDownSize(Size& minSize, Size& preferredMinSize, Size& preferredSize, Size& maxSize) at Infragistics.Win.UltraWinToolbars.BackStageMenuAgent.GetPopupControl() at Infragistics.Win.UltraWinToolbars.BackStageMenuAgent.DropDown(Rectangle fileMenuButtonRect, Boolean resetActiveContentTool) at Infragistics.Win.UltraWinToolbars.BackStageMenuAgent.DropDown(Rectangle fileMenuButtonRect) at Infragistics.Win.UltraWinToolbars.ApplicationMenuAgentBase.DropDown() at Infragistics.Win.UltraWinToolbars.ApplicationMenuBase.DropDown() at WindowsFormsApplication1.Form1.Form1_Load(Object sender, EventArgs e) in D:\My Documents\My Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 22 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) InnerException:
Hello zxfwinder,
I was not able to reproduce your scenario so I attached my sample in this post. Everything is working fine with the code I am using. Please review my application and feel free to let me know if there is something bothering you.
I still encounter this problem and I can repro it in your sample application if I move the call:
ultraToolbarsManager1.Ribbon.ApplicationMenu2010.DropDown();
into the constructor or into a handler for the Form's "Load" event.
Is there an easy way to have the 2010 style application menu automatically drop down when the form is opened?
Hello,
You can solve this problem in three ways
1. As indicated here, call DropDown() in the Form1_Paint event (and set a flag after the menu is opened in order to execute only once)
http://defdeveloper.blogspot.ro/2005_01_01_archive.html
2. Add a timer to the form, call DropDown() in the timer1_Tick event (and of course stop the timer in order to execute only once)
3. As indicated here, call DropDown() in the Form1_Shown event
http://es.infragistics.com/community/forums/t/8031.aspx
Forgot to mention that I'm using the 13.1.20131.2048 dlls.