MFC中设置文本背景颜色和文本颜色为什么会无效?
BOOLCMainFrame::OnCommand(WPARAMwParam,LPARAMlParam){intMenuCmdID=LOWORD(wParam);CMen...
BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam)
{
int MenuCmdID = LOWORD(wParam);
CMenu2View *pView = (CMenu2View*)GetActiveView();
if(MenuCmdID >= IDM_PHONE1 && MenuCmdID < IDM_PHONE1 + pView->m_strArr.GetSize())
{
CClientDC dc(pView);
dc.SetBkColor(GetSysColor(RGB(255, 0, 34)));//为什么我在这里
//设置了文本背景颜色和文本颜色,但是打印出来的时候依然是白底黑字呢?
dc.SetTextColor(GetSysColor(RGB(255, 0, 34)));//
dc.TextOut(0, 0, pView->m_strArr.GetAt(MenuCmdID-IDM_PHONE1));
return TRUE;
}
return CFrameWnd::OnCommand(wParam, lParam);
} 展开
{
int MenuCmdID = LOWORD(wParam);
CMenu2View *pView = (CMenu2View*)GetActiveView();
if(MenuCmdID >= IDM_PHONE1 && MenuCmdID < IDM_PHONE1 + pView->m_strArr.GetSize())
{
CClientDC dc(pView);
dc.SetBkColor(GetSysColor(RGB(255, 0, 34)));//为什么我在这里
//设置了文本背景颜色和文本颜色,但是打印出来的时候依然是白底黑字呢?
dc.SetTextColor(GetSysColor(RGB(255, 0, 34)));//
dc.TextOut(0, 0, pView->m_strArr.GetAt(MenuCmdID-IDM_PHONE1));
return TRUE;
}
return CFrameWnd::OnCommand(wParam, lParam);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询