📄 subject_39049.htm
字号:
<p>
序号:39049 发表者:kingnee 发表日期:2003-05-07 20:30:22
<br>主题:树形控件 屏蔽的代码没用,还是没将图形显示
<br>内容:问题所在:屏蔽的代码没用,还是没将图形显示<BR> <BR>BOOL CTreeDlg::OnInitDialog() 事件中定义如下:<BR> CDialog::OnInitDialog();<BR> TV_ITEM tvItem;<BR> tvItem.mask=TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE;<BR> tvItem.pszText="C:";<BR> tvItem.cchTextMax=2;<BR>// tvItem.iImage=IDB_BITMAP1;<BR> <BR> TV_INSERTSTRUCT tvInsert;<BR> tvInsert.hParent=TVI_ROOT;<BR> tvInsert.hInsertAfter=TVI_LAST;<BR> tvInsert.item=tvItem;<BR> HTREEITEM hRoot=m_TreeCtrl.InsertItem(&tvInsert);<BR><BR> tvItem.pszText="系统";<BR> tvItem.cchTextMax=6;<BR> tvInsert.hParent=hRoot;<BR> tvInsert.item=tvItem;<BR> m_TreeCtrl.InsertItem(&tvInsert);<BR><BR> tvItem.pszText="应用程序";<BR> tvItem.cchTextMax=7;<BR> tvInsert.hParent=hRoot;<BR> tvInsert.item=tvItem;<BR> m_TreeCtrl.InsertItem(&tvInsert);<BR> <BR> tvItem.pszText="E:";<BR> tvItem.cchTextMax=2;<BR> tvInsert.hParent=TVI_ROOT;<BR> tvInsert.item=tvItem;<BR> m_TreeCtrl.InsertItem(&tvInsert);<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:wowow 回复日期:2003-05-08 09:32:22
<br>内容:iImage并不是你的BITMAP的资源ID,而是imagelist的次序。<BR>1.在你的CTreeDlg.h中定义一个成员变量:CImageList imageTree;<BR><BR>2.在CDialog::OnInitDialog();后加上下面的代码:<BR>imageTree.Create(16, 16, ILC_MASK, 1, 0); // 大小为16x16<BR>imageTree.SetBkColor(RGB(255,255,255)); // 背景色为白色<BR>CBitmap bmpItem;<BR>bmpItem.LoadBitmap(IDB_BITMAP1);<BR>imageTree.Add(&bmpItem, RGB(255, 255, 255));<BR>m_TreeCtrl.SetImageList(&imageTree, TVSIL_NORMAL);<BR><BR>3.再把tvItem.iImage=IDB_BITMAP1换成:<BR>tvItem.iImage = 0;<BR><BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:kingnee 回复日期:2003-05-08 21:19:17
<br>内容:谢谢,大侠!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:wowow 回复日期:2003-05-08 21:44:17
<br>内容:如果OK的话,别忘了给我分.
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:kingnee 回复日期:2003-05-10 20:45:16
<br>内容:好的,蜂王兄!!!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -