Hi all,
I am trying to add key board shortcuts for Infragistics ButtonTools:
private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager toolbarsManager;
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1;
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2;
Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenuTool1;
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3;
Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4;
buttonTool1.SharedProps.Caption = "abc";
buttonTool1.SharedProps.Shortcut = System.Windows.Forms.Shortcut.AltF1;
buttonTool2.SharedProps.Caption = "def";
buttonTool2.SharedProps.Shortcut = System.Windows.Forms.Shortcut.AltF2;
popupMenuTool1.SharedProps.Caption = "ghi";
popupMenuTool1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
buttonTool3,
buttonTool4});
this.toolbarsManager.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
buttonTool1,
buttonTool2,
popupMenuTool1});
this.toolbarsManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.toolbarsManager_ToolClick);
The result of this code is that event is not fired with keyboard shortcut but mouse click fires the correct event. Any thoughts/suggestions would be helpful.
Does anyone has a remedy for this issue?
I was not able to reproduce the problem based on the original description. I tried with 11.1 and the RTM version of 9.2. Can you provide a sample which demonstrates the issue?
Hello Suyar,
I've created a private support case for this issue. You'll see it listed if you go to the My Support Activity area of our web-site.
Thank you Mike. I'll post the answer, whatever it may be.
I don't think I could accurately reproduce your scenario with this amount of code given the added complexity of a CAB application. I think it would be better if DS handled this. I have forwarded this post to the Developer Support Manager and a DS engineer will be contacting you about this issue.
Thanks for your quick reply Mike.
Our app is using CAB framework and we've recently upgraded from Infragistics WinClient 8.3 to 10.3. The "CtrlS" used to work in 8.3. We are not 100% sure if this is related to the upgrade, but we'd like to eliminate the possibility that is/not related to the upgrade.
There is a thread (http://community.infragistics.com/forums/t/42524.aspx) related to this issue, which we've already looked into.
Here is the code snippet (please see the bold text in question):
Public Class ReferralController Inherits XYZController Public Overrides Sub Run() MyBase.Run() Me.BuildReferralToolbar() End Sub Private Sub BuildReferralToolbar() 'PATTERN TO CREATE CUSTOM ACTION BARS 'Set a unique toolbar name using the Constant & WorkItem.ID & Add it to local collection _ReferralToolbarName = ReferralConstants.UIExtensionSiteNames.ReferralToolbar & WorkItem.ID _ToolbarNameArray.Add(_ReferralToolbarName) 'Create a new toolbar _ReferralToolbar = New UltraToolbar(_ReferralToolbarName) 'add toobar to the action bar _ReferralToolbar = _ActionbarWorkspace.Toolbars.AddToolbar(_ReferralToolbarName) 'set properties of the toolbar _ReferralToolbar.DockedPosition = DockedPosition.Bottom _ReferralToolbar.DockedColumn = 0 _ReferralToolbar.DockedRow = 0 'Add it to the array for cleanup _ToolbarArray.Add(_ReferralToolbar) 'register the toolbar as a UIExtentionSite (important!!!! it is the .Tools collection to register) WorkItem.UIExtensionSites.RegisterSite(_ReferralToolbarName, _ReferralToolbar.Tools) 'Get the reference of the UIExtentionSite (this is important!!!!) _ReferralToolbarSite = WorkItem.UIExtensionSites(_ReferralToolbarName) 'ADD BUTTONS Dim Btn As ButtonTool Btn = New ButtonTool(ReferralConstants.CommandNames.SaveReferral & WorkItem.ID) 'Use a WorkItem.ID suffix for uniqueness Btn.SharedProps.Caption = "Save Referral" 'Add the ButtonTool to the UIExtentionSite (not the toolbar) Btn = WorkItem.UIExtensionSites(_ReferralToolbarName).Add(Btn) 'Add the ButtonTool to the local Tools Array for cleanup _ToolsArray.Add(Btn) 'Hookup a Command WorkItem.Commands(FamilyCivil.ReferralConstants.CommandNames.SaveReferral).AddInvoker(Btn, "ToolClick") Btn.SharedProps.Shortcut = Shortcut.CtrlS Btn = Nothing End Sub End Class <CommandHandler(ReferralConstants.CommandNames.SaveReferral)> _Public Sub SaveReferral(ByVal sender As Object, ByVal e As EventArgs) Me.SaveReferral()End Sub
Thank you,
Spiro