Dymamic Edit Boxes
-
i have already created an edit box dynamically using the create function. now my requirement is when i type something on the edit box the size of the edit box should increase as the sentence gets bigger? what needs to be done for this?
-
i have already created an edit box dynamically using the create function. now my requirement is when i type something on the edit box the size of the edit box should increase as the sentence gets bigger? what needs to be done for this?
You have two choices: - Subclass the edit control. - Handle the
EN_UPDATE
notification in the edit control's parent.Steve
-
You have two choices: - Subclass the edit control. - Handle the
EN_UPDATE
notification in the edit control's parent.Steve
will u be able to explain a little more.?
-
will u be able to explain a little more.?
Chandrasekharanp wrote:
will u be able to explain a little more.?
search sublass here at CP, you will get answer to yo
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
will u be able to explain a little more.?
Adding to the answer already given... You can change the size with
SetWindowPos(...)
Greetings. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
-
Chandrasekharanp wrote:
will u be able to explain a little more.?
search sublass here at CP, you will get answer to yo
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
ThatsAlok wrote:
search sublass here at CP, you will get answer to yo
And for more explain google is a option.;)
-
ThatsAlok wrote:
search sublass here at CP, you will get answer to yo
And for more explain google is a option.;)
Hamid. wrote:
And for more explain google is a option.
;P
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You
-
i have already created an edit box dynamically using the create function. now my requirement is when i type something on the edit box the size of the edit box should increase as the sentence gets bigger? what needs to be done for this?
One way to do this is to change the size of the editbox dynamically using
SetWindowPos()
API. Use this API inWM_CHAR
orEN_CHANGE
notification. like below.INT Widht =0; //width of the charcter
INT Height = 10 //height of the charcter
case WM_CHAR: ( or EN_CHAGE)
//X,Y is the position of the edit box.
SetWindowPos(hWndEdit,0,X,Y,Height,Width++);
break;above code will work. But you need to take care when to grow the editbox and when to shrink it. ( i.e if someone press backspace or delete the editbox should shrink. )
[ Screen Capture ][ Tool Tip ][ Muliple Desktops ][Greeting Card ]