Alternative to &Caption for a button in VBA

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
 
N

NickHK

Maybe you can explain what you mean by "no go" ?
I cannot see what you have done.

NickHK
 
I

itsyash

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
 
P

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
 
I

itsyash

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
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top