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

Posted on 2007-07-31
Last Modified: 2013-11-26

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);

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 :)
Question by:shinymoon
    LVL 19

    Accepted Solution

    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.

    Author Comment

    Thank you :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    759 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

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now