如图所示,选中某一个图案后在Edit没有显示,请问是什么原因?
DrawItem部分代码如下:
CRect rc = lpDrawItemStruct->rcItem;
CDC dc;
if (!dc.Attach(lpDrawItemStruct->hDC))
{
return;
}
Graphics g(dc.m_hDC);
Pen pen(Color(255,0,0),1);
if (lpDrawItemStruct->itemState & ODS_FOCUS)
{
g.DrawRectangle(&pen,rc.left,rc.top,rc.Width(),rc.Height());
}
if (lpDrawItemStruct->itemID == -1)
return;
HatchBrush hbr((HatchStyle)GetItemData(lpDrawItemStruct->itemID),Color(0,0,0),Color(255,255,255));
g.FillRectangle(&hbr,rc.left,rc.top,rc.Width(),rc.Height());
dc.Detach();