473,412 Members | 2,306 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,412 software developers and data experts.

How to make a Label Box act as Enter Key on click?

283 100+
Hello everyone,

Not sure if I made my question header very clear but not sure how else to word it so i appoligize to the admins in advance.

What I have is a form where I have one text box for keying in a word and then I have a save button. The save button i made is not a button but a label that saves the information on click. The problem I'm having is if you key information in to the text box and then press the save label button it will not save, but if you key in information in to the text box then press the Enter key and then press the save button it works. Is there anyway i can get the save button to act as the Enter key press on the text box first before it saves??

I have been trying to use the KeyAcsii(13) function in the OnClick command but so far im getting no luck. Also the form is Unbound.

Any help would be great!

Thanks in advance,

Slen
Feb 10 '11 #1
2 2782
Hi Slen,

I don't why you would want to use a label as a button but I'm sure you have a reason :-)

I think the reason that the OnClick command isn't working is because as you click on the label, you're losing focus from the text box.

Would it be possible to create an invisible command button and have the label OnClick activate it?
Or place a transparent command button in front of the label?

- Michael

EDIT: To get around the focus problem you could also assign the KeyAcsii(13) function to the OnMouseMove command for the label, I believe it's similar to MouseOver
Feb 10 '11 #2
slenish
283 100+
Hi Michael,

Thanks so much for the reply,

actually i figured out how to make it work. You are right that once I would click on the label it would take focus away from the Text box so what i did was I added in the command [Me.Refresh] at the beginning of my code when you click on the save (label) button, and now it works.

Thanks again for the reply appreciate the help :D
Feb 13 '11 #3

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

Similar topics

2
by: Yogi_Bear_79 | last post by:
I have a for each loop, that currently runs through an array of 11,000+ items. I exerpted the code part below that I have a question on. I thought this code would update the form label and...
4
by: M Shafaat | last post by:
Hi! How can I make label, linklabel . controls to accept multilined text at design time and in the properties window of Visual Studio? Regards M Shafaat
12
by: SJ | last post by:
Hope someone can help me out there I'm struggling with a particular problem... I have a form with many tab pages. On one tab page I've got a button which when clicked with a mouse adds items...
0
by: Thomas Wegener | last post by:
I created a nonmodal dialog with a PropertyGrid control. I added an Enter-, Click-, MouseClick and MouseHover event If I start the dialog the enter event are called If I leave dialog and reenter...
2
by: pemigh | last post by:
Client's fingers have been well trained on another application to wrap lines by hitting shift-enter, and wants the same in Access application. Changing "enter key behavior" for controls is not...
2
by: thi | last post by:
Hi Experts, I am new to C# moving from VB 6.0. Basic i want to know how do i make the label transparent with the control color it currently on. For example I have a picturebox control...
1
by: pippyn | last post by:
I'm programming for a CE device with reduced key board, no mouse, and no touch screen. As such, I have to tab from button to button to get the focus on the button i want. Then to invoke the button...
0
by: 2Barter.net | last post by:
MAKE SURE TO CLICK 2 < < < 25 mar 2007 http://www.crawler.com/search/results.aspx?w=web&pts=1&tbid=60001&q=C... 21 mar 2007 Thank you Sincerely: Crawler For your barter for 2Barter...
8
by: Ronald S. Cook | last post by:
How do I make a label bold at runtime (i.e. in code)? Thanks, Ron
1
by: sjarmy | last post by:
I am using javascript to make a dropdownlist act like a combobox and it is work well. The issue I'm having is when the user types in the combobox and finds the selection he wants, he has to use the...
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
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.