Coloring Rect of Create(lpszText,dwstyle,&rect,parentwnd,nID) white
I have below code
Code:
CStatic *text = new CStaic ;
CRect textrect(10,20,70,50);
MapDialogRect(&tectrect);
text -> Create(name.data(),WS_CHILD | WS_VISIBLE | SS_RIGHT,textrect,this);
The problem is text is displayed on rectangle with gray color. How can i paint that rectangle color to white?
Re: Coloring Rect of Create(lpszText,dwstyle,&rect,parentwnd,nID) white
Try to handle WM_CTLCOLORSTATIC message.
BTW, have you solved your problem with Editbox control?
Re: Coloring Rect of Create(lpszText,dwstyle,&rect,parentwnd,nID) white
You really need to use the resource editor. You're developing a really bad habit.
Re: Coloring Rect of Create(lpszText,dwstyle,&rect,parentwnd,nID) white
Quote:
Originally Posted by
Beginner_MFC
I have below code
Code:
CStatic *text = new CStaic ;
CRect textrect(10,20,70,50);
MapDialogRect(&tectrect);
text -> Create(name.data(),WS_CHILD | WS_VISIBLE | SS_RIGHT,textrect,this);
The problem is text is displayed on rectangle with gray color. How can i paint that rectangle color to white?
You could also subclass this static control (deriving your own class from CStatic and overriding OnPaint method).
I'd also recommend you to check out this site where you will find a lot of very useful tips and tricks including Changing Dialog Box/CFormView Color and many others.
Re: Coloring Rect of Create(lpszText,dwstyle,&rect,parentwnd,nID) white
Yes i solved editbox problem by passing correct parameters in CRect()
Re: Coloring Rect of Create(lpszText,dwstyle,&rect,parentwnd,nID) white
Quote:
Originally Posted by
Beginner_MFC
Yes i solved editbox problem by passing correct parameters in CRect()
Then it would be a good idea to share the solution and mark that thread as resolved! ;)