Alternative to &Caption for a button in VBA

  • Thread starter Thread starter itsyash
  • Start date Start date
I

itsyash

Hi All,

I am trying to change the caption of a button in VBA to &Submit. If i
did this in VB then i would get an underline below the letter S in
"Submit" which would make it a shortcut. However, in VBA it shows
&Sumit as the caption.

Can some one pls guide me on how to do this VBA.

Thanks in advance,
Yash
 
when i type "&Submit" in the caption property of the button, it shows
the text as it is and does nothing if i press alt+S. If it was VB it
would have fired the submit button.

What exactly do i have to to with the .accelerator property to get
this working?

Yash
 
Unlike VB(6), in VBA userforms most controls an 'Accelerator' property.
Select your button, press F4 and look in properties.

Type simply 'S' without the & in the property. This will allow user to Alt-S
to your button. Also unlike VB, the accelerator key does not need to exist
in the caption, though if it does it will be underlined.

Regards,
Peter T
 
Unlike VB(6), in VBA userforms most controls an 'Accelerator' property.
Select your button, press F4 and look in properties.

Type simply 'S' without the & in the property. This will allow user to Alt-S
to your button. Also unlike VB, the accelerator key does not need to exist
in the caption, though if it does it will be underlined.

Regards,
Peter T







- Show quoted text -

Thanks Peter,

That worked...However, the accelerator is in the caption as well, but
still does not show an underline. The drawback is that users wont
understand that there is a short cut.

Yash
 
Thanks Peter,

That worked...However, the accelerator is in the caption as well, but
still does not show an underline. The drawback is that users wont
understand that there is a short cut.

Yash

Does the underline appear if you press Alt

Depending on your Windows version try looking at -

Display properties, Appearance, Effects and the 'Hide underlined keys...'
option.

Regards,
Peter T
 
Back
Top