Hello,
I created a toolbar manager and put dynamically groups and items on it. but when the mouse is over it it cause an error :
System.NullReferenceException:. ב- Infragistics.Win.UltraWinToolbars.SharedProps.get_ShortcutString() ב- Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.DisplayToolTip(ToolBase tool) ב- Infragistics.Win.UltraWinToolbars.ToolBase.DisplayToolTip() ב- Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.set_ImmediateToolTipDisplayMode(Boolean value) ב- Infragistics.Win.UltraWinToolbars.ButtonToolUIElement.OnMouseHover() ב- Infragistics.Win.ControlUIElementBase.NotifyMouseHover(UIElement element) ב- Infragistics.Win.ControlUIElementBase.ProcessMouseHover(Object sender, EventArgs e) ב- Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) ב- Infragistics.Win.UltraControlBase.OnMouseHover(EventArgs e) ב- System.Windows.Forms.Control.WmMouseHover(Message& m) ב- System.Windows.Forms.Control.WndProc(Message& m) ב- System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) ב- System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) ב- System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Thanks,
Yossy
It looks like the SharedProps of the root tools are not getting hooked up to their owning tools correctly. What code do you use to dynamically create one of the tools added to the ribbon group?
Hello Mike,
This is a sample of the code:
m_hMemuBar.Ribbon.QuickAccessToolbar.Visible = false;
ButtonTool[ btnToolCard_Save = new ButtonTool[2] { new ButtonTool("btnCard_Save"), new ButtonTool("btnCard_SaveAll") };
btnToolCard_Save[0].InstanceProps.PreferredSizeOnRibbon = RibbonToolSize.Large;
btnToolCard_Save[1].SharedProps.Caption = "שמור הכל";
btnToolCard_Save[1].SharedProps.AppearancesLarge.Appearance.Image = new System.Drawing.Icon(Constants.Constants.IconsPath() + "save_all.ico").ToBitmap();
grpCard_Save.Tools.AddRange(btnToolCard_Save);
buttonTool1.SharedProps.Caption = "הגדרות";
buttonTool5.SharedProps.Caption = "יציאה";
m_hMemuBar.Tools.AddRange(new ToolBase[ { buttonTool1, buttonTool5 });
m_hMemuBar.Ribbon.ApplicationMenu.ToolAreaRight.MaxWidth = 0;
I sent the problem to the support team and they realse a new HotFix that fix this problem. I think before you will change your code check this HotFix. If it will not help update me and I will try so search the help sample or send you my code snippet.
Good luck,
I tried another code (from IG help) and its worked.
I send the problem to the support Team also.
Thnak you any case,
This looks like it could be a bug. I would recommend submitting the issue to the support group: http://ko.infragistics.com/gethelp. You might be able to work around the issue by adding the tools in a different way. For the first set of tools added, create the tools as you are but only set values on their SharedProps. Then add them to the toolbars manager, not the group. Then, on the group, add new instances of the tools like this:
grpCard_Save.Tools.AddToolRange(new string[{ "btnCard_Save", "btnCard_SaveAll" });
Get the new instance tools back from the group and set the properties on their InstanceProps like this:
ToolBase tool1 = grpCard_Save.Tools[ "btnCard_Save" ];tool1.InstanceProps.PreferredSizeOnRibbon = RibbonToolSize.Large;
As for the tools added to the application menu, when you add the tools to the ToolAreaLeft, don't add the tools to the NonInheritedTools collection. This is only needed for design-time support when visual inheritance may be used. Instead, use the Tools.AddToolRange method as shown above and pass in the tool keys.