how to show only 10 lines in edit box
-
hi i run a thread to show some line in edit box and in every second thread add one line but i want to show only last added ten lines in edit box,how is this possible thank you
-
hi i run a thread to show some line in edit box and in every second thread add one line but i want to show only last added ten lines in edit box,how is this possible thank you
If I understand it right, your question boils down to: "How can I update the contents in an edit box?" And the answer is, with the help of a member variable.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. ...formerly known as brahmma Codeproject.com: Visual C++ MVP
-
If I understand it right, your question boils down to: "How can I update the contents in an edit box?" And the answer is, with the help of a member variable.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. ...formerly known as brahmma Codeproject.com: Visual C++ MVP
hi rajesh you r absolutely right.can u tell me with the help of some code
-
hi rajesh you r absolutely right.can u tell me with the help of some code
There is no serious coding. Add a member variable to your edit control and name it as
m_str
. Now, you can alter the value of this variable like:m_str = _T("some new value");
and then callUpdateData(false);
to reflect it on the screen.Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. ...formerly known as brahmma Codeproject.com: Visual C++ MVP
-
There is no serious coding. Add a member variable to your edit control and name it as
m_str
. Now, you can alter the value of this variable like:m_str = _T("some new value");
and then callUpdateData(false);
to reflect it on the screen.Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. ...formerly known as brahmma Codeproject.com: Visual C++ MVP
i think u r not understanding my problem.i am able to show string in the edit box.but my actual problem is that in every one second i am adding on line.and only want to show 10 lines means i want to erase the one oldest line when the one new line is inserted
-
hi i run a thread to show some line in edit box and in every second thread add one line but i want to show only last added ten lines in edit box,how is this possible thank you
How about keeping the 10 lines in a
CStringArray
(or similar) object instead? Then the edit control can be updated from this object. Does this sound plausible?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
i think u r not understanding my problem.i am able to show string in the edit box.but my actual problem is that in every one second i am adding on line.and only want to show 10 lines means i want to erase the one oldest line when the one new line is inserted
rajneshmalik wrote:
and only want to show 10 lines means i want to erase the one oldest line when the one new line is inserted
Use a CStringList to accomplish the same. Look at CStringList::RemoveHead() function. Your task would become easy with it.
Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. ...formerly known as brahmma Codeproject.com: Visual C++ MVP
modified on Tuesday, January 08, 2008 9:44:03 AM