We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to immulate ''Click'' event using Alt+Letter

The Alt-letter causes the BarItem to issue a Selected event. I cannot use the Selected event to handle action activation since it’s issued also when mouse is moved over the item. It appears as if there is no consistant way for both keyboard and mouse to activate a BarItem. Could I force an XPMenus.BarItem to issue a Click event when I use Alt+Letter for a BarItem, directly added to an XPMenus.Bar.

1 Reply

AD Administrator Syncfusion Team September 14, 2004 01:37 PM UTC

Hi MMarinich, You could use the following workaround to force the BarItem to issue a Click event when Alt+Letter is pressed. // Override the host form''s ProcessCmdKey method as shown in code below : protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == (Keys.Alt | Keys.F)) { this.barItem1.PerformClick(); } else if (keyData == (Keys.Alt | Keys.E)) { this.barItem2.PerformClick(); } else if (keyData == (Keys.Alt | Keys.V)) { this.barItem3.PerformClick(); } else if (keyData == (Keys.Alt | Keys.H)) { this.barItem4.PerformClick(); } return base.ProcessCmdKey (ref msg, keyData); } Please refer to the sample attached here that illustrates this and let me know if this works for you. Regards, Guru Patwal Syncfusion, Inc.

Live Chat Icon For mobile
Up arrow icon