N/APosted on - 10/14/2012
How to clear text of static text mfc? I don’t know how to perform this kind of clearing text. I need your guidance or step by step instruction to get this done properly. There are some instances that it will not be cleared but I hope this time it will.
How to clear text of static text mfc?
You can use following method to clear the text.
First get the item by calling GetDlgItem method. For example
CWnd* pWindow = GetDlgItem(IDC_Label_STATIC);
Then Setting its text my using the following code
Other way to do this is to declare the variable as static, then initializing it as static control and then changing the value.
Static_text = new CStatic;
Static_text->Create("I'm a static", WS_CHILD | WS_VISIBLE,
CRect(3, 4, 11, 18), this, 900);
I hope it will help you.