?
Solved

[ms vc++ .net 2005] questions about textbox

Posted on 2007-07-31
2
Medium Priority
?
283 Views
Last Modified: 2013-11-26
Hi,

I've been searching in msdn library, but couldn't figure out.

1. Does anyone know how to set the maximum lengh of text in a textbox?

2. how can I highlight the text in a textbox? My situation is when a user enters invalid input, it pops up a warning diolog with OK button on it. When a user click on OK button, it goes back to the main window and select the invalid text. Neither below code lines didn't work.
textBox->Select(0, textBox->Text->Length);
textBox->SelectAll();

3. I have these two textbox. When a user pushes TAB key on keyboard, I want the cursor to move from the first text box to the second text box. Does anyone know how to do that? I've found below code line, but don't know exactly how I should do..
textBox->AcceptsTab = true;

Any advise will help. Thank you :)
0
Comment
Question by:shinymoon
2 Comments
 
LVL 19

Accepted Solution

by:
drichards earned 2000 total points
ID: 19606168
1. Set textBox->MaxLength = <desired value>

2. Change the HideSelection property of the textbox to false or set the focus back to the textbox after doing SelectAll()

3. Set AcceptsTab = false and set correct tab index on the controls.
0
 

Author Comment

by:shinymoon
ID: 19619749
Thank you :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month16 days, 15 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question