I am working on a C# WinForm application in Visual Studio 2008 and are using DevExpress.
I have added shortcuts to Some of the buttons (DevExpress SimpleButton) which triggers a button click (CTRL + R, CTRL B and so on…). I would like to show the shortcut texts in a tooltip next to each button when the user press and hold the CTRL key.
I have tried to use the DevExpress control ‘ToolTipController’ and that works OK if I only have one tooltip. But I would like to show more than one tooltip at a time. It seems like only the last tooltip that is added is shown.
Is it possible to show more than one tooltip at a time? Or does anyone have any other suggestion on how to solve this problem?
I solved this by creating a WPF control that looks similar to a standard tooltip (small box with a label). I then did an override on ProcessCmdKey and OnKeyUp on my form to listen to CTRL key down and key up.
When the user presses and holds down the CTRL key I loop through all my controls that has a shortcut and creates a WPF control on top of that control. For each WPF control I set the corresponding shortcut text. When the CTRL key is released I remove all WPF controls in OnKeyUp.