ReaLTaiizor icon indicating copy to clipboard operation
ReaLTaiizor copied to clipboard

Buttons support shortcut keys

Open FreeVB opened this issue 2 years ago • 6 comments

How to make buttons support shortcut keys?

FreeVB avatar Apr 11 '22 01:04 FreeVB

We grateful you making your first issue notification. You can be sure that a return will be made as soon as possible.

github-actions[bot] avatar Apr 11 '22 01:04 github-actions[bot]

I showed you how to do it in the project below.

ShortcutKey.zip image

Taiizor avatar Apr 11 '22 02:04 Taiizor

Sorry, I may not have made it clear. I mean to add shortcut keys to the button, just like an ordinary button, like the picture below. tt

FreeVB avatar Apr 11 '22 06:04 FreeVB

Just like the system button below, the underline will be displayed under the letter "t", and press Alt + T to respond to the event.

FreeVB avatar Apr 11 '22 07:04 FreeVB

I understand the problem now. It works on some components. But the first character is not underlined.

ShortcutKey

I will not do anything to fix this problem. Because there are too many components. I can't spend that much time on this project.

My suggestion is to create underline text from the website below and name the button. You then create shortcuts using MethodA or MethodB.

https://yaytext.com/underline

ShortcutSampleKey

ShortcutKey.zip

Taiizor avatar Apr 11 '22 12:04 Taiizor

In protected override void onpaint (painteventargs E), this can achieve the same effect as the system button, but it does not respond after pressing the shortcut key. StringFormat sf = new(StringFormatFlags.NoWrap | StringFormatFlags.NoClip); if (ShowKeyboardCues) sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show; else sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Hide; sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center;

FreeVB avatar Apr 13 '22 01:04 FreeVB

MaterialButton now supports it.

Taiizor avatar Sep 29 '22 14:09 Taiizor