473,406 Members | 2,698 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 select all content when tabbed

I have two textboxes in my windows form. When i switch between the
textboxes by using the tab-button, i want the content of the next
textbox to be completely selected so that i can start typing it over
right away. How can i do this?

All help appreciated.
Nov 20 '05 #1
6 3286
CT
Add the following text to the TextBox.Enter event:

TextBox.SelectAll()

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Kenny" <ge*******@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
I have two textboxes in my windows form. When i switch between the
textboxes by using the tab-button, i want the content of the next
textbox to be completely selected so that i can start typing it over
right away. How can i do this?

All help appreciated.

Nov 20 '05 #2
"Kenny" <ge*******@hotmail.com> schrieb
I have two textboxes in my windows form. When i switch between
the textboxes by using the tab-button, i want the content of the
next textbox to be completely selected so that i can start typing it
over right away. How can i do this?


In the Enter event:

directcast(sender, textbox).selectall

You can use the same procedure to handle the Enter event of both textboxes.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
* ge*******@hotmail.com (Kenny) scripsit:
I have two textboxes in my windows form. When i switch between the
textboxes by using the tab-button, i want the content of the next
textbox to be completely selected so that i can start typing it over
right away. How can i do this?


That's the default behavior, at least on Windows XP Professional.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4
CT
Try entering and deleting the text in a text box and tab to and from it,
then it won't auto-select the entire text.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:c7***********@ID-208219.news.uni-berlin.de...
* ge*******@hotmail.com (Kenny) scripsit:
I have two textboxes in my windows form. When i switch between the
textboxes by using the tab-button, i want the content of the next
textbox to be completely selected so that i can start typing it over
right away. How can i do this?


That's the default behavior, at least on Windows XP Professional.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 20 '05 #5
* "CT" <ca******@spammersgoawaydotnetservices.biz> scripsit:
Try entering and deleting the text in a text box and tab to and from it,
then it won't auto-select the entire text.


Thank you for making me aware of that. This will occur if you changed
the text of the textbox.

Solution: Add a handler to the textbox's 'GocFocus' event (you will
have to create this handler yourself because it's not listed in the
list of available events) and enter this code:

\\\
DirectCast(sender, TextBox).SelectAll()
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #6
"CT" <ca******@spammersgoawaydotnetservices.biz> wrote in message news:<#k**************@TK2MSFTNGP10.phx.gbl>...
Add the following text to the TextBox.Enter event:

TextBox.SelectAll()

--
Carsten Thomsen


Thx!
Nov 20 '05 #7

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

Similar topics

6
by: A P | last post by:
Hi! I have seen some techniques like this on the web. Currently, I'm using Combo box which values came from database table. One disadvantage is when the combo box have lots of values, users are...
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...
7
by: Sandy | last post by:
Hello - I have a form that when submitted checks the database and if the username is already taken, a label shows indicating same. I need to make that label NOT visible after the user clicks...
1
by: melanieab | last post by:
Hi again, I have a textbox where the text is longer than the textbox width. When I type something in there or even do any single keystroke (other than tab, up, down, or enter) and then leave, the...
8
by: nil | last post by:
Hello all, It's urgent... i want to add autocomplete textbox facility in my application like google. as you type it suggests option to the user..i want the same kind of facility...i know i...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
8
by: jackrabbithanna | last post by:
I'm using a ajax script the uses a tabbed div that fetches a remote webpage to display for each tab.when clicked. the script works fine except for one thing. The content of the page i want to...
7
by: billa856 | last post by:
Hi, My project is in MS Access 2002. In that I have two forms which I am using for Shipping Entry. Now First Form(ShippingAlerts) Is fillup by persons working in customer services.and the Second...
5
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
Hi Guys, It's been a while, I've got a small problem that I could do with your expertise on. As you know (I Think) I build websites for recruitment agencies, part of the website includes a job...
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:
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
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...

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.