CMyStatic refresh problem
-
I have drived a class from CStatic control. I am using my own method to set text CMyStatic::SetText(). I am drawing text using dc.DrawText(strText,&rectWnd,DT_VCENTER| DT_RIGHT | DT_WORDBREAK); in paint method but If I want to set another string It is getting overlapped. So I am not able to see the extact string. How to solve this refreshing problem?
-
I have drived a class from CStatic control. I am using my own method to set text CMyStatic::SetText(). I am drawing text using dc.DrawText(strText,&rectWnd,DT_VCENTER| DT_RIGHT | DT_WORDBREAK); in paint method but If I want to set another string It is getting overlapped. So I am not able to see the extact string. How to solve this refreshing problem?
From where do you get the strText? The problem might be because the underlying CStatic controls window text is set (and drawn). In your SetText(), you might have to clear this by calling SetWindowText(_T("")). Depending on what you mean by overlapping, another reason could be that your rectangle isn't large enough to fit the text, in which case you can use the flag DT_CALCRECT to get the size needed.
-
From where do you get the strText? The problem might be because the underlying CStatic controls window text is set (and drawn). In your SetText(), you might have to clear this by calling SetWindowText(_T("")). Depending on what you mean by overlapping, another reason could be that your rectangle isn't large enough to fit the text, in which case you can use the flag DT_CALCRECT to get the size needed.
I am passing text from outside using SetText function. This static control is drawn over a custome dialog which is having some color, If I use SetWindowText(_T()) I am getting window native color. Overlapping means , One test is drawn on anothet text. I am giving enough size to draw.
-
I am passing text from outside using SetText function. This static control is drawn over a custome dialog which is having some color, If I use SetWindowText(_T()) I am getting window native color. Overlapping means , One test is drawn on anothet text. I am giving enough size to draw.
Setting the background mode of the DC to OPAQUE may help. See http://msdn.microsoft.com/en-US/library/a3w1xce7.aspx[^]
-
I have drived a class from CStatic control. I am using my own method to set text CMyStatic::SetText(). I am drawing text using dc.DrawText(strText,&rectWnd,DT_VCENTER| DT_RIGHT | DT_WORDBREAK); in paint method but If I want to set another string It is getting overlapped. So I am not able to see the extact string. How to solve this refreshing problem?
-
I am passing text from outside using SetText function. This static control is drawn over a custome dialog which is having some color, If I use SetWindowText(_T()) I am getting window native color. Overlapping means , One test is drawn on anothet text. I am giving enough size to draw.