Page 1 of 1

Changing Shortcuts

Posted: Mon Oct 16, 2017 9:44 am
by DanielR
Hello Stimulsoft Team,

We are using your reports embedded in our own Software, therefore I made a inheritance of the StiViewerControl.
Now I'm trying to change some Shortcuts in my Class, because I need the F7-Button(normaly used as "SearchNext") for our own Software.
I would like to change the Shortcut of the "SearchNext"-Button to F3 and remove the shortcuts for the "ZoomOnePage"(F3)- and "ZoomTwoPages"(F4)-Button.

I tried the following Code:

Code: Select all

public partial class clsStiViewer : Stimulsoft.Report.Viewer.StiViewerControl
    {
        public clsStiViewer()
        {
            InitializeComponent();

            // Remove the old Shortcuts
            this.View.viewerControl.ToolBar.Items["icZoomPages"].SubItems["tbZoomOnePage"].Shortcuts[0] = Stimulsoft.Controls.Win.DotNetBar.eShortcut.None;
            this.View.viewerControl.ToolBar.Items["icZoomPages"].SubItems["tbZoomTwoPages"].Shortcuts[0] = Stimulsoft.Controls.Win.DotNetBar.eShortcut.None;

            // Set the new Shortcut and change the tooltip
            this.View.viewerControl.FindBar.Items["tbFindNext"].Shortcuts[0] = Stimulsoft.Controls.Win.DotNetBar.eShortcut.F3;
            ((Stimulsoft.Controls.Win.DotNetBar.ButtonItem)this.View.viewerControl.FindBar.Items["tbFindNext"]).AlternateShortCutText = "F3";
        }
    }
While debugging i can see that the Buttons have the right shortcuts ("ZoomOnePage" and "ZoomTwoPages" have no shortcut, "FindNext" has F3) still the Shortcuts don't work.

How can I force the Shortcuts to be changed?

Kind regards
Daniel

Re: Changing Shortcuts

Posted: Wed Oct 18, 2017 4:35 pm
by HighAley
Hello, Daniel.

Sorry for the delay with answer.
We need some additional time to prepare an answer.

Thank you.

Ticket reference: #3150212

Re: Changing Shortcuts

Posted: Thu Oct 19, 2017 2:57 pm
by HighAley
Hello, Daniel.

Please, try next code to set necessary shortcuts:

Code: Select all

((Stimulsoft.Controls.Win.DotNetBar.ButtonItem)this.View.viewerControl.ToolBar.Items["icZoomPages"].SubItems["tbZoomOnePage"]).Shortcuts.Clear();
((Stimulsoft.Controls.Win.DotNetBar.ButtonItem)this.View.viewerControl.ToolBar.Items["icZoomPages"].SubItems["tbZoomTwoPages"]).Shortcuts.Clear();
((Stimulsoft.Controls.Win.DotNetBar.ButtonItem)this.View.viewerControl.FindBar.Items["tbFindNext"]).Shortcuts.Clear();
((Stimulsoft.Controls.Win.DotNetBar.ButtonItem)this.View.viewerControl.FindBar.Items["tbFindNext"]).Shortcuts.Add(Stimulsoft.Controls.Win.DotNetBar.eShortcut.F3);
Thank you.

Re: Changing Shortcuts

Posted: Wed Oct 25, 2017 7:18 am
by DanielR
Hello,

the provided code works fine.

Thank you
Daniel

Re: Changing Shortcuts

Posted: Wed Oct 25, 2017 9:27 am
by Ivan
Hello,

We are always glad to help you.
Let us know if you need any additional help.

Thank you.