My project currently uses a mix of Microsoft's Windows Forms controls for legacy UIs and Infragistics controls for more recently-developed UIs. I have noticed an apparent discrepancy in the UseMnemonic property for the Windows Forms Label and the UltraButton controls. No other posts on the forums here appear to address this issue.
For example, if I have a label on a Windows Form in VB6 with a caption of "&Name", the N in "Name" is underlined to show that it is a hotkey. However, if I have an UltraButton with "&Cancel" as its text in a form with a C# back-end, the first C in "Cancel" does not display as a mnemonic until I press the Alt key. In both controls, I have set UseMnemonic to True.
For a label in VB6, UseMnemonic "returns/sets a value that specifies whether an & in a Label's Caption property defines an access key." For an UltraButton, UseMnemonic "determines whether mnemonics are displayed and processed." Why would enabling the same property cause different behavior in those two controls? I expected that they would be the same. I would like the C# form to display the mnemonics in the same way that the VB6 form displays them. Is there another property in UltraButton or another Infragistics control that I can use in order to ensure this result?
Thanks in advance.
You are using the DotNet controls in VB6? I didn't realize that was even possible. I'm pretty sure it's not a condition that we test our controls under.
I don't have VB6 to test with, but I have used UltraButton and UltraLabel in Visual Studio 2000 and up and I've never heard of issue like this in a DotNet environment.
Some operating systems intentionally do not show mnemonics underlined until you press the Alt Key. Does it work you press Alt? Perhaps the inbox VB6 controls are in error for showing the underlines all the time and the Infragistics controls are properly honoring the operating system settings.
It does work when I press Alt. That seems to be sufficient for now. Thanks!
I have the same problem the underscore doesn't appear. It shows in design view but when I run the application it is not there. But pressing Alt and another key does the intended job.
This is a function of the operating system. On the newer ones like Windows 7 and Windows Vista, the underscores for mnemonics do not display until you press the Alt key.
I notice Microsoft VS2010 and Office 2007 (under Windows 7) show the shortcut at all times. Perhaps you could add a property so we can have both options
Hi,
We could do that. But it's a bit odd to handle this on the application level since there is an option in Windows to change this behavior.
Anyway, I recommend that you Submit a feature request to Infragistics