Click here to Skip to main content
16,004,991 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Required C++ source code for below question Pin
Joan M25-Apr-08 8:47
professionalJoan M25-Apr-08 8:47 
GeneralRe: Required C++ source code for below question Pin
Prasann Mayekar26-Apr-08 0:28
Prasann Mayekar26-Apr-08 0:28 
GeneralRe: Required C++ source code for below question Pin
enhzflep27-Apr-08 1:09
enhzflep27-Apr-08 1:09 
GeneralRe: Required C++ source code for below question Pin
David Crow27-Apr-08 15:17
David Crow27-Apr-08 15:17 
GeneralChanging colour for CStatic Pin
prithaa25-Apr-08 3:58
prithaa25-Apr-08 3:58 
GeneralRe: Changing colour for CStatic Pin
David Crow25-Apr-08 4:41
David Crow25-Apr-08 4:41 
GeneralRe: Changing colour for CStatic Pin
Mark Salsbery25-Apr-08 5:53
Mark Salsbery25-Apr-08 5:53 
GeneralRe: Changing colour for CStatic Pin
prithaa25-Apr-08 19:36
prithaa25-Apr-08 19:36 
Hello,

Still the background colour has not changed .I really don't understand how can an easy task of changing colours can be so difficult.Please take a look at my class and suggest me the possible errors. Sorry for the trouble.

My class is like this.

Class TableFrame : public CMDIChildWnd
{
Public :
Void PrintHeading();
Private :
Vector<CStatic*> Heading;
Protected :
afx_msg LRESULT ONCTLCOLORSTATIC(WPARAM wParam,LPARAM lParam);
};


BEGIN_MESSAGE_MAP(TableFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(TableFrame)
ON_MESSAGE(WM_CTLCOLORSTATIC, ONCTLCOLORSTATIC)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()


Void TableFrame ::PrintHeading()
{
int x=0;

CFont* m_pFont;

LOGFONT LogFont;
memset(&LogFont, 0x00, sizeof(LogFont));
strcpy(LogFont.lfFaceName, _T("MS Sans Serif"));
LogFont.lfHeight = 12;

m_pFont = new CFont;
m_pFont->CreateFontIndirect(&LogFont);
SetFont(m_pFont);

for(int i=0;i<m_TableDoc.GetmDataFields().size();++i)
{
CStatic* Static = new CStatic;
CString String = ColumnHead[i];
x = i*(COLUMNSPACE + 100);
CRect Rect(x,0,x+100,20);
Static->Create(String, WS_VISIBLE, Rect, this,i);
Heading.push_back(Static);
}
}

LRESULT TableFrame::ONCTLCOLORSTATIC(WPARAM wParam, LPARAM lParam)
{
HDC hDC = (HDC)wParam;
::SetTextColor(hDC, RGB(0x00,0x00,0xFF)); // text color bright blue
::SetBkColor(hDC, RGB(0xFF,0x00,0x00)); // text background color
return (LPARAM)(HBRUSH)hbr; // control background
}


Regards
Thanks
Pritha
QuestionRe: Changing colour for CStatic Pin
Rajkumar R25-Apr-08 23:38
Rajkumar R25-Apr-08 23:38 
QuestionRe: Changing colour for CStatic Pin
David Crow27-Apr-08 15:15
David Crow27-Apr-08 15:15 
GeneralRe: Changing colour for CStatic Pin
prithaa28-Apr-08 0:30
prithaa28-Apr-08 0:30 
GeneralRe: Changing colour for CStatic Pin
David Crow28-Apr-08 4:04
David Crow28-Apr-08 4:04 
Generalhi i want to generate binary states in sorting order in terms of no of 1's plz help Pin
Member 465568525-Apr-08 3:39
Member 465568525-Apr-08 3:39 
GeneralRe: hi i want to generate binary states in sorting order in terms of no of 1's plz help PinPopular
David Crow25-Apr-08 3:55
David Crow25-Apr-08 3:55 
GeneralRe: hi i want to generate binary states in sorting order in terms of no of 1's plz help Pin
Nelek27-Apr-08 1:56
protectorNelek27-Apr-08 1:56 
Questionx64 intrinsic function equivalent for inline assembly? Pin
Maxwell Chen25-Apr-08 0:41
Maxwell Chen25-Apr-08 0:41 
GeneralRe: x64 intrinsic function equivalent for inline assembly? Pin
Rajkumar R25-Apr-08 0:58
Rajkumar R25-Apr-08 0:58 
GeneralRe: x64 intrinsic function equivalent for inline assembly? Pin
Maxwell Chen25-Apr-08 1:15
Maxwell Chen25-Apr-08 1:15 
GeneralRe: x64 intrinsic function equivalent for inline assembly? Pin
Rajkumar R25-Apr-08 2:48
Rajkumar R25-Apr-08 2:48 
GeneralRe: x64 intrinsic function equivalent for inline assembly? Pin
Maxwell Chen25-Apr-08 5:05
Maxwell Chen25-Apr-08 5:05 
GeneralRe: x64 intrinsic function equivalent for inline assembly? Pin
Mike Dimmick25-Apr-08 3:43
Mike Dimmick25-Apr-08 3:43 
GeneralRe: x64 intrinsic function equivalent for inline assembly? Pin
Maxwell Chen25-Apr-08 5:03
Maxwell Chen25-Apr-08 5:03 
GeneralRe: x64 intrinsic function equivalent for inline assembly? Pin
Ozer Karaagac25-Apr-08 13:38
professionalOzer Karaagac25-Apr-08 13:38 
QuestionRe: x64 intrinsic function equivalent for inline assembly? Pin
bob1697225-Apr-08 3:08
bob1697225-Apr-08 3:08 
GeneralRe: x64 intrinsic function equivalent for inline assembly? Pin
Mike Dimmick25-Apr-08 3:44
Mike Dimmick25-Apr-08 3:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.