why my CStatic doesn't show its text?
-
I have a modeless dialog, when one of its button is pressed, I called a subroutine to load a file. Since the operation is lengthy, I want to give user some feedback that sth is going on. So I want to show a text string. I did the following: CStatic textProgress; textProgress.Create(_T("Image loading..."), WS_CHILD | WS_VISIBLE|SS_CENTER, CRect(CPoint(rectDlg.left+nOffset, rectDlg.CenterPoint().y-2*nOffset), CSize(rectDlg.Width()-2*nOffset, nOffset)), pParent); but when the system runs, I saw the rectangle at the position specified, but no text. why? :confused: Thanks for any help!
-
I have a modeless dialog, when one of its button is pressed, I called a subroutine to load a file. Since the operation is lengthy, I want to give user some feedback that sth is going on. So I want to show a text string. I did the following: CStatic textProgress; textProgress.Create(_T("Image loading..."), WS_CHILD | WS_VISIBLE|SS_CENTER, CRect(CPoint(rectDlg.left+nOffset, rectDlg.CenterPoint().y-2*nOffset), CSize(rectDlg.Width()-2*nOffset, nOffset)), pParent); but when the system runs, I saw the rectangle at the position specified, but no text. why? :confused: Thanks for any help!
-
Try this instead of pParent. Haakon S. A sure cure for seasickness is to sit under a tree. Spike Milligan
-
I don't have access to "this", since it's not a member function, but a global function. I also have a CProgressCtrl in this global function, it's being showed ok.
-
Did you try updating the static control? Is this static control in another thread? If not then it needs to be repainted to show the text. like: mystatic.RedrawWindow() etc. this is this.