0

I'm working on a vba project right now, and am having trouble getting the access keys to display properly. Here is my code:

btnCalculate.Text = "&Calculate Total"
btnClear.Text = "Clear &Form"
btnExit.Text = "&Exit"

This is done in the properties box on the form design screen of visual studios 2019. My problem is this: on the form design, the underline displays normally. When I run the program, however, the underlines do not display until I hit the alt key. After that they display normally

I have not had this happen before as the access keys on my other projects have displayed fine. They do work, it's just the display that I am having trouble with as my teacher will take off points. If anyone knows how to fix this I'd appreciate the help

braX
  • 11,506
  • 5
  • 20
  • 33
Leslie
  • 23
  • 3
  • 1
    That's a feature of your operating system, not something you code for. – braX Apr 07 '20 at 17:23
  • Ah okay then. Is there a way to turn that feature off? – Leslie Apr 07 '20 at 17:52
  • https://www.tenforums.com/tutorials/97413-turn-off-underline-access-key-shortcuts-menus-windows-10-a.html – braX Apr 07 '20 at 17:53
  • 1
    Thank you very much ^_^ – Leslie Apr 07 '20 at 17:54
  • I think this is better for VBA (Access, Excel): btnCalculate.Caption= "&Calculate Total" btnClear.Caption = "Clear &Form" btnExit.Caption = "&Exit". One uses .Caption instead of .Text for form buttons. – jacouh Apr 07 '20 at 19:31

0 Answers0