移动对话框中TOOLBAR的位置
我想把对话框中工具栏的问题放在特定的地方,有什么方法?
我自己想的是获得这个工具栏的指针,然后调用SetWindowPos, 方法可行么?
我自己用TOOLBAT这个对象直接去GetClentRect获得的矩形参数全是0,求解释和方法
另:
HBRUSH CToolbarWinDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
// TODO: Return a different brush if the default is not desired
if (nCtlColor==CTLCOLOR_STATIC)
{
pDC->SetTextColor(RGB(255, 0, 0));
pDC->SetBkMode(TRANSPARENT);
}
return hbr;
}
对话框上的静态文本背景还是灰色,我贴了图做背景,想把静态文本的灰色背景透明,坐等高人解答,谢谢!
[解决办法]
1. 一般调用DockControlBar/RepositionBars
2. 调用了pDC->SetBkMode(TRANSPARENT);之后,返回一个NULL_BRUSH
HBRUSH br = (HBRUSH)GetStockObject(NULL_BRUSH); // 初始化地方赋值
if (nCtlColor==CTLCOLOR_STATIC)
{
pDC->SetTextColor(RGB(255, 0, 0));
pDC->SetBkMode(TRANSPARENT);
return br;
}