Shortcut keys to textbox

  • Thread starter Thread starter Maurice Mertens
  • Start date Start date
M

Maurice Mertens

Hi,

I'm trying to set shortcut keys for textboxes. But what is the best way to
do this in VB.NET. In Access it was very simple, just put an "&" sign in
the label that belongs to the textbox. But in VB.NET it looks like you have
to program code for the shortcut keys.

Like putting this code in the Form_KeyUp:

If e.Alt And e.KeyCode = Keys.L Then Me.ActiveControl = Me.TextBox1



Is this correct?


--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering


Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502
 
Set the tab index of the text box to be next to that of its associated label
control in sequence (eg: Label TabIndex is 6 and its TextBox TabIndex is 7).
And have & in the Label control for the short-cut key and that should work.

HTH.

Hi,

I'm trying to set shortcut keys for textboxes. But what is the best way to
do this in VB.NET. In Access it was very simple, just put an "&" sign in
the label that belongs to the textbox. But in VB.NET it looks like you have
to program code for the shortcut keys.

Like putting this code in the Form_KeyUp:

If e.Alt And e.KeyCode = Keys.L Then Me.ActiveControl = Me.TextBox1



Is this correct?


--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering


Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502
 
Maurice,

I do not see what you exactly want to archieve. Maybe others see it but not
me. Refering to MS Access in the dotNet newsgroups is not the best way of
explaining when you want to have the best answers, a lot have expirience
with that, but the most who are very deep in dotNet probably a long time not
anymore.

However because you are using VBNet you have probably a better change by
posting your question (as well) to the newsgroup
microsoft.public.dotnet.languages.vb

(You can send your further explanations here or/and to the VBNet newsgroup
just as you wish, you are free to do what you want)

Cor

"Maurice Mertens"
 
Shiva,

Now I understand what was the problem and the solution I would not have
thought about that.

Nice

Cor
 
HTH,

thanks for the answer, it works fine now!


Maurice



Set the tab index of the text box to be next to that of its associated
label control in sequence (eg: Label TabIndex is 6 and its TextBox
TabIndex is 7). And have & in the Label control for the short-cut key
and that should work.

HTH.

message Hi,

I'm trying to set shortcut keys for textboxes. But what is the best
way to do this in VB.NET. In Access it was very simple, just put an
"&" sign in the label that belongs to the textbox. But in VB.NET it
looks like you have to program code for the shortcut keys.

Like putting this code in the Form_KeyUp:

If e.Alt And e.KeyCode = Keys.L Then Me.ActiveControl = Me.TextBox1



Is this correct?



--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering


Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502
 
Back
Top