In forms is it possible to underline a letter in the text of a command botton and in the label of a text box. The command botton is pressed when pressing ALT-<underlined letter> and the textbox is focused in the same way. How do I do in my userform to use the same functionality? Ebbe
In the Properties pane, when the label or command button is selected, find the property named Accelerator. Set that property to the letter you want underlined. If a letter in the label caption is to be the accelerator for a text box, then you must make the TabIndex value of the label one less than the TabIndex value of the text box. The reason is that the focus first goes to the label (because it has the accelerator), but because a label can't accept the focus, the focus immediately goes to whatever control is next in the tab order. You want the text box to be that next control. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Sat, 13 May 2006 18:04:52 +0200, "Ebbe" wrote: >In forms is it possible to underline a letter in the text of a command >botton and in the label of a text box. >The command botton is pressed when pressing ALT-<underlined letter> and the >textbox is focused in the same way. >How do I do in my userform to use the same functionality? > >Ebbe >
"Ebbe" wrote in message news:%230nv5bqdGHA.3556@TK2MSFTNGP02.phx.gbl... > In forms is it possible to underline a letter in the text of a command > botton and in the label of a text box. > The command botton is pressed when pressing ALT-<underlined letter> and > the textbox is focused in the same way. > How do I do in my userform to use the same functionality? > > Commandbuttons and various other controls have an Accelerator property. Set that to the letter you want underlined. -- Regards Jonathan West - Word MVP www.intelligentdocuments.co.uk Please reply to the newsgroup Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Thank you to both of You :-) It whas exactly, what I was looking fore. Ebbe "Jonathan West" skrev i en meddelelse news:%23OmORrrdGHA.1320@TK2MSFTNGP04.phx.gbl... > > "Ebbe" wrote in message > news:%230nv5bqdGHA.3556@TK2MSFTNGP02.phx.gbl... >> In forms is it possible to underline a letter in the text of a command >> botton and in the label of a text box. >> The command botton is pressed when pressing ALT-<underlined letter> and >> the textbox is focused in the same way. >> How do I do in my userform to use the same functionality? >> >> > > Commandbuttons and various other controls have an Accelerator property. > Set that to the letter you want underlined. > > > -- > Regards > Jonathan West - Word MVP > www.intelligentdocuments.co.uk > Please reply to the newsgroup > Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org