⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_20245.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:20245 发表者:张奇 发表日期:2002-11-04 21:16:09
<br>主题:请问怎么改变clistctrl 每一行的行高
<br>内容:知道调整宽度<BR>但是一旦要调整高度就烦难了<BR>那位大侠知道麻烦告诉一声<BR>谢谢
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:David Wong 回复日期:2002-11-04 21:51:35
<br>内容:1.<BR>//////////////////////////////////////////////////////////////////////<BR>// in the header file<BR>&nbsp;&nbsp;&nbsp;&nbsp;//{{afx_msg(cmylistctrl)<BR>&nbsp;&nbsp;&nbsp;&nbsp;:<BR>&nbsp;&nbsp;&nbsp;&nbsp;:<BR>&nbsp;&nbsp;&nbsp;&nbsp;//}}afx_msg<BR>&nbsp;&nbsp;&nbsp;&nbsp;afx_msg void measureitem ( lpmeasureitemstruct lpmeasureitemstruct );<BR>&nbsp;&nbsp;&nbsp;&nbsp;declare_message_map()<BR><BR>//////////////////////////////////////////////////////////////////////<BR>// in the cpp file<BR>begin_message_map(cmylistctrl, clistctrl)<BR>&nbsp;&nbsp;&nbsp;&nbsp;//{{afx_msg_map(cmylistctrl)<BR>&nbsp;&nbsp;&nbsp;&nbsp;:<BR>&nbsp;&nbsp;&nbsp;&nbsp;:<BR>&nbsp;&nbsp;&nbsp;&nbsp;//}}afx_msg_map<BR>&nbsp;&nbsp;&nbsp;&nbsp;on_wm_measureitem_reflect( )<BR>end_message_map()<BR><BR>void CXXXListCtrl::MeasureItem(lpmeasureitemstruct lpmeasureitemstruct)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;// update here<BR>&nbsp;&nbsp;&nbsp;&nbsp;lpmeasureitemstruct-&gt;itemheight = XXXX;<BR>}<BR><BR>2.<BR>good luck<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>
回复者:啊志 回复日期:2002-11-04 22:14:14
<br>内容:谢谢David Wong,让我长见识了!<BR>我刚才差了半天都没查到,以为没有哪。现在一查lpmeasureitemstruct,真是惊喜!!<BR><BR>献上一些资料:<BR>lpMeasureItemStruct: <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A long pointer to a MEASUREITEMSTRUCT structure. <BR><BR>MEASUREITEMSTRUCT结构:<BR><BR>The MEASUREITEMSTRUCT structure informs Windows of the dimensions of an owner-drawn control or menu item.<BR><BR>typedef struct tagMEASUREITEMSTRUCT {<BR>&nbsp;&nbsp; UINT CtlType;<BR>&nbsp;&nbsp; UINT CtlID;<BR>&nbsp;&nbsp; UINT itemID;<BR>&nbsp;&nbsp; UINT itemWidth;<BR>&nbsp;&nbsp; UINT itemHeight;<BR>&nbsp;&nbsp; DWORD itemData<BR>} MEASUREITEMSTRUCT;<BR><BR>Parameters<BR><BR>CtlType <BR>&nbsp;&nbsp;Contains the control type. The values for control types are as follows: <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ODT_COMBOBOX&nbsp;&nbsp; Owner-draw combo box <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ODT_LISTBOX&nbsp;&nbsp; Owner-draw list box <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ODT_MENU&nbsp;&nbsp; Owner-draw menu <BR>CtlID <BR>&nbsp;&nbsp;&nbsp;&nbsp; Contains the control ID for a combo box, list box, or button. This member is not used for a menu. <BR><BR>itemID <BR>&nbsp;&nbsp;&nbsp;&nbsp; Contains the menu-item ID for a menu or the list-box-item ID for a variable-height combo box or list box. This member is not used for a fixed-height combo box or list box, or for a button. <BR><BR>itemWidth <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the width of a menu item. The owner of the owner-draw menu item must fill this member before it returns from the message. <BR><BR>itemHeight <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specifies the height of an individual item in a list box or a menu. Before it returns from the message, the owner of the owner-draw combo box, list box, or menu item must fill out this member. The maximum height of a list box item is 255. <BR><BR>itemData <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For a combo box or list box, this member contains the value that was passed to the list box by one of the following: <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CComboBox::AddString <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CComboBox::InsertString <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CListBox::AddString <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CListBox::InsertString <BR>For a menu, this member contains the value that was passed to the menu by one of the following: <BR><BR>CMenu::AppendMenu <BR>CMenu::InsertMenu <BR>CMenu::ModifyMenu <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>
回复者:徐景周 回复日期:2002-11-05 10:04:34
<br>内容:可参看下面源码,是从CListCtrl派生而成的属性表控件类,内有详细操作,可参看:<BR>http://www.copathway.com/itbookreview/view_paper.asp?paper_id=158
<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 + -