473,382 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Shortcut keys to textbox

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
Jul 21 '05 #1
4 3312
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.

"Maurice Mertens" <mauricem@moviat_KillSpamWordForEMail.nl> wrote in message
news:Xn****************************@207.46.248.16. ..
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
Jul 21 '05 #2
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"
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

Jul 21 '05 #3
Shiva,

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

Nice

Cor

"Shiva" <sh******@online.excite.com>
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.

"Maurice Mertens" <mauricem@moviat_KillSpamWordForEMail.nl> wrote in
message
news:Xn****************************@207.46.248.16. ..
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

Jul 21 '05 #4
HTH,

thanks for the answer, it works fine now!
Maurice

"Shiva" <sh******@online.excite.com> wrote in
news:#g**************@TK2MSFTNGP12.phx.gbl:
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.

"Maurice Mertens" <mauricem@moviat_KillSpamWordForEMail.nl> wrote in
message news:Xn****************************@207.46.248.16. ..
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
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nick | last post by:
In VS 2003 and VS 2005 beta 2 I am trying to write a simple program. It has a datagrid and a textbox along with a menubar. There is a command in the menu bar which is "Run Query" and has the...
0
by: Ollie | last post by:
When a form has a default button (Form.AcceptButton) and\or a shortcut key for that button (e.g. "&Process") and this button happens to close the form when clicked. Why does the control that...
1
by: Kimochi | last post by:
Hi, i want to ask view questions 1.when i press Enter button on the textbox how do i trigger an event? 2.How do i use shortcut key for example ctrl+s to call certain function.
4
by: Maurice Mertens | last post by:
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...
1
by: Emma Middlebrook | last post by:
Hi there, I'm trying to handle some shortcut keys within my application and I can't seem to get the code to work when you are trying to action against a ctrl + other character. I found a post...
0
by: thirunavukarasukm | last post by:
Hai... How to Usercontrols with Shortcut Keys... I am creating one windows apllication.. the apllication contain many form.. in one form i am used one usercontrol(parent control)..
1
sujathaeeshan
by: sujathaeeshan | last post by:
Hi all, I need to provide shortcut keys for controls like text box and buttons etc... That is i dont want to go for tabspace or mouse click for perticular controls.. By having shortcut keys i...
2
by: Andrus | last post by:
If focused control is ReadOnly, menu shortcut key is ignored. To reproduce, run code below, press Ctrl+E. Note that message box does not appear. This issue blocks Ctrl+E usage in application....
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a textbox containing a listview of items. I would like to set it up so that when that textbox has the focus and I press ctl-A from the keyboard it selects all the items. Dealing...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.