📄 subject_20245.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> //{{afx_msg(cmylistctrl)<BR> :<BR> :<BR> //}}afx_msg<BR> afx_msg void measureitem ( lpmeasureitemstruct lpmeasureitemstruct );<BR> declare_message_map()<BR><BR>//////////////////////////////////////////////////////////////////////<BR>// in the cpp file<BR>begin_message_map(cmylistctrl, clistctrl)<BR> //{{afx_msg_map(cmylistctrl)<BR> :<BR> :<BR> //}}afx_msg_map<BR> on_wm_measureitem_reflect( )<BR>end_message_map()<BR><BR>void CXXXListCtrl::MeasureItem(lpmeasureitemstruct lpmeasureitemstruct)<BR>{<BR> // update here<BR> lpmeasureitemstruct->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> 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> UINT CtlType;<BR> UINT CtlID;<BR> UINT itemID;<BR> UINT itemWidth;<BR> UINT itemHeight;<BR> DWORD itemData<BR>} MEASUREITEMSTRUCT;<BR><BR>Parameters<BR><BR>CtlType <BR> Contains the control type. The values for control types are as follows: <BR> ODT_COMBOBOX Owner-draw combo box <BR> ODT_LISTBOX Owner-draw list box <BR> ODT_MENU Owner-draw menu <BR>CtlID <BR> Contains the control ID for a combo box, list box, or button. This member is not used for a menu. <BR><BR>itemID <BR> 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> 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> 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> 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> CComboBox::AddString <BR> CComboBox::InsertString <BR> CListBox::AddString <BR> 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 + -