473,395 Members | 1,386 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,395 software developers and data experts.

How do I assign shortkeys to text boxes?

I'm trying to assign a shortkey to a text box via a label control adjacent to the text box, but I dont know how link the label to the box. Any suggestions?
Dec 17 '10 #1
3 1226
johny10151981
1,059 1GB
your idea is not clear.

I worked on VB around 2 years ago. Cant recall much.

But I think Label do not receive any Focus. So I think that this is not possible.

or did you mean you want to assign value of certain text field to label field after pressing certain key while that text box is focused? it is possible Try OnKeyPress or onKeyDown or OnKeyUp action. Do two thing first set the text(text) to label(caption) and then set the value of keycode to zero. It will do
Dec 17 '10 #2
The Label MUST have the TabIndex Property set to TextBox's TabIndex Property - 1

Example: If TextBox's TabIndex = 2 then Label's TabIndex must be = 1
Dec 17 '10 #3
smartchap
236 100+
Please make the query clear. Do u want to set focus to the adjacent TextBox when Label (adjacent to the textbox) is clicked? Then write code like:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Label1_Click()
  2.     Text1.SetFocus
  3. End Sub
  4.  
  5. Private Sub Label2_Click()
  6.     Text2.SetFocus
  7. End Sub
  8.  
Dec 18 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Gertjan van Heijst | last post by:
Hi, I really hope someone can help me because I've already spend 2 days on this problem and I'm not getting anywhere. I think the problem is that I don't really understand how text boxes store...
2
by: John Kreps | last post by:
(acc 2002) I've got six unbound text boxes on a subform that has a white background. Each of those six boxes has an expression that when true, will change its background from white to another...
1
by: Kris | last post by:
Hi, I have a DataGrid where in each row has couple of text boxes and an update button. Each row is dynamically generated as the number of rows are not known ahead of time. When the user clicks the...
15
by: Rick | last post by:
Hello, I'm trying to create a javascript function that will allow the user to press a button within the html code that will add a text box right above the button. If the user presses it a...
11
by: Edson Peacock | last post by:
I have a report with sub reports, one of the subreports have 12 text boxes that are 2" high and I want them all to grow if one goes to 3" high. If anyone has any suggestions they are very much...
1
by: Venu gopal | last post by:
I am getting month and year in two text boxes but I want to both in one text boxe. I have tried using both ways but I have faield. Example: 012006 'MonthYear = "imonth" & "iyear" Month3.Text =...
3
by: Venu gopal | last post by:
I am getting month and year in two text boxes but I want to both in one text boxe. I have tried using both ways but I have faield. Example: 012006 'MonthYear = "imonth" & "iyear" Month3.Text =...
6
by: BurntWithTime | last post by:
Hello everyone, Please can anyone tell me if it is possible for a VB.NET application to check a database and then create textboxes on a form that correspond to those records on the database? For...
1
by: tomlebold | last post by:
Should text boxes or combo boxes be renamed on bound forms? In other word should the Department Name property be the same as Control Source property? I never rename them, but my IT manager seems...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.