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

TextBox - SelectAll() Problem

I have one text box where I enter a number. I can either click the calculate button or use the accept property (enter) to perform the calculation and display the answer in a label.

I use the SelectAll() method to select the number in the text box when it has the focus.

When I use the calculate button is works correctly but when I just hit enter the text box has the focus but the number is not selected.

What could I be doing wrong?
Feb 23 '08 #1
3 1403
daniel aristidou
491 256MB
I have one text box where I enter a number. I can either click the calculate button or use the accept property (enter) to perform the calculation and display the answer in a label.

I use the SelectAll() method to select the number in the text box when it has the focus.

When I use the calculate button is works correctly but when I just hit enter the text box has the focus but the number is not selected.

What could I be doing wrong?
Um the problem is probably in the event you entered the code.
Try using the (either/or both) click event and the got focus event
Feb 24 '08 #2
Killer42
8,435 Expert 8TB
A couple of questions to help clarify the situation...
- What version of VB are you using?
- How are you intercepting the Enter?
Feb 25 '08 #3
debasisdas
8,127 Expert 4TB
You need to handle the key down event .
Feb 25 '08 #4

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

Similar topics

2
by: bullshark | last post by:
VSN03:C# Create a C# Windows Form project. Add two TextBox controls. From the Properties of each, add an Enter Event handler. In the generated Enter Event Handlers (textBox1_Enter &...
3
by: Phill | last post by:
I thought when you tabbed into a textbox that the text it contained was automatically highlighted. This use to be the default in win32. Is there an easy way to do this in .NET. I don't want this...
5
by: Mike L | last post by:
This is my first attempt at inheriting a class. I want to inherit textbox class to my derived class ClassNum. ClassNum will override the TextChanged, Leave, KeyPress and Enter methods. So,...
4
by: Mario | last post by:
Hi there, I'm trying to do an easy thing... but no luck so far... I have a form with a textbox, and I want the following behaviour on mouse click event: -if no text is selected, select all...
10
by: Jane Sharpe | last post by:
Hi, I have a textbox with the words "Enter your name here" inserted as default text - At the moment, to remove this the user must highlight all the text and delete before they type in their name...
12
by: Gene Hubert | last post by:
How do I make a TextBox behave like the address bar in IE? That is... If focus is not on the tb, select all text if clicking on the tb or tabbing into the tb. Clicking again deselects the text...
8
by: cj | last post by:
I asked this question a couple of days ago but am just now looking at it again. I used to use the textbox gotfoucs event to have all the text in the textbox selected when it gotfocus. That...
1
by: subbarao.puvvada | last post by:
Hi All, I am working on a Windows application, Which browser control on main form itself develped in .NET 1.1. Recently we have migrated it to .NET 2.0. It's combination of Web pages and .NET...
2
by: lmefford | last post by:
Is there a way to modify all textboxes on a form so that when you click on any of them you process the SelectAll() function. For exaple, let's say I've created a form with 30 textboxes. These...
7
by: Anil Gupte | last post by:
I have read a lot about getting lines from a multiline textbox in VB.Net. However, I cannot for the life of me figure out how to write to a multiline textbox. Basically, I have created an array of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.