能否在一对话框上生成一个CHeaderCtrl类的表头?请指点。 本人看了很多例程,发现CHeaderCrtl类一般在CListCtrl及CListView中使用,但我现在希望能在一个空的对话框上生成一个表头,不知有无办法? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 本人看了很多例程,发现CHeaderCrtl类一般在CListCtrl及CListView中使用,但我现在希望能在一个空的对话框上生成一个表头,不知有无办法?说明白些 add a member to your dialog class CHeaderCtrl m_HeaderCtrl;in the OnIntialDiglog() // TODO: Add extra initialization here RECT rc; rc.left = 10; rc.top = 10; rc.right = 320; rc.bottom = 40; m_HeaderCtrl.Create (HDS_BUTTONS, rc, this, 1234); HDITEM item; char textbuf[]="header in dlg"; item.mask = HDI_HEIGHT | HDI_TEXT | HDI_FORMAT; item.fmt = HDF_STRING; item.cxy = 175; item.pszText = textbuf; item.cchTextMax = sizeof(textbuf)+2; item.fmt = HDF_LEFT; // LOGFONT lf;// ::ZeroMemory (&lf, sizeof (lf));// lf.lfHeight = 80;// lf.lfWeight = FW_BOLD;// lf.lfItalic = FALSE;// ::lstrcpy (lf.lfFaceName, _T ("MS Sans Serif"));// CFont* m_Font = new CFont();// VERIFY (m_Font -> CreatePointFontIndirect (&lf));// m_HeaderCtrl.SetFont (m_Font, TRUE);// delete m_Font; m_HeaderCtrl.InsertItem (0, &item); m_HeaderCtrl.ShowWindow (SW_SHOW); 在MFC中,数据库删除的不是我点击的那一行数据 [Help]求VLC media player的源代码。。。 windows api VC群: 3150527 有关线程钩子 关于CPaintDC类的几个疑问 如何暂停程序的执行(SDK下)? vc里怎么创建和复制文件夹,别说用循环呀 【编程类】关于微软数字签名 谁能找到? 有关在TreeCtrl中搜索的算法。 怎么在本程序的PE文件中自定义一个SECTION,并开辟一个大空间?
说明白些
CHeaderCtrl m_HeaderCtrl;
in the OnIntialDiglog() // TODO: Add extra initialization here
RECT rc;
rc.left = 10;
rc.top = 10;
rc.right = 320;
rc.bottom = 40;
m_HeaderCtrl.Create (HDS_BUTTONS, rc, this, 1234);
HDITEM item;
char textbuf[]="header in dlg";
item.mask = HDI_HEIGHT | HDI_TEXT | HDI_FORMAT;
item.fmt = HDF_STRING;
item.cxy = 175;
item.pszText = textbuf;
item.cchTextMax = sizeof(textbuf)+2;
item.fmt = HDF_LEFT;
// LOGFONT lf;
// ::ZeroMemory (&lf, sizeof (lf));
// lf.lfHeight = 80;
// lf.lfWeight = FW_BOLD;
// lf.lfItalic = FALSE;
// ::lstrcpy (lf.lfFaceName, _T ("MS Sans Serif"));
// CFont* m_Font = new CFont();
// VERIFY (m_Font -> CreatePointFontIndirect (&lf));
// m_HeaderCtrl.SetFont (m_Font, TRUE);
// delete m_Font;
m_HeaderCtrl.InsertItem (0, &item);
m_HeaderCtrl.ShowWindow (SW_SHOW);