how to limit text in the txt control Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
jkbagain
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed May 09, 2007 1:01 am
Location: Manila,Philippines
Contact:

how to limit text in the txt control

Post by jkbagain » Fri May 11, 2007 12:57 am

could you pls help me on how to limit the number of characters to be written on the txt cntrl for i have a txtcontrol to write infinitely and want I want is to limit the characters into 9 or 10 characters only...How shall i perform that?



Thanks in advanced.....
What important in a problem is not the solution but the lessons you learned in finding the solution.

lester
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Sep 02, 2006 7:24 pm
Location: Ukraine

Post by lester » Fri May 11, 2007 2:27 am

wxTextCtrl::SetMaxLength(unsigned long len)

jkbagain
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed May 09, 2007 1:01 am
Location: Manila,Philippines
Contact:

Thnkz

Post by jkbagain » Fri May 11, 2007 2:57 am

thanks for your SetMaxLength but it is still a failure on my part because i could not able to run my program if i uses that member...

Here is my idea on my program:


wxTextCtrl *txtctrl=new wxTextCtrl(this,-1,_T(""),wxPoint(140,25),wxSize(130,25));
txtctrl->SetMaxLength(unsigned long 5);

Everytime i compile this program on the terminal it always flag a message of
error:expected primary-expression before unsigned...
what is the primary function needed?
What important in a problem is not the solution but the lessons you learned in finding the solution.

lester
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Sep 02, 2006 7:24 pm
Location: Ukraine

Post by lester » Fri May 11, 2007 3:02 am

txtctrl->SetMaxLength(5);

jkbagain
Knows some wx things
Knows some wx things
Posts: 29
Joined: Wed May 09, 2007 1:01 am
Location: Manila,Philippines
Contact:

TY

Post by jkbagain » Fri May 11, 2007 3:13 am

thanks.....I really appreciate your help
What important in a problem is not the solution but the lessons you learned in finding the solution.

lester
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 211
Joined: Sat Sep 02, 2006 7:24 pm
Location: Ukraine

Post by lester » Fri May 11, 2007 3:16 am

always glad to help

Post Reply