elcapitan
asked on
Changing rowsheight in CListCtrl
Hi All,
I tried to change font size of CListCtrl object. Unfortunately the row height of the control was not updated, and the text got clipped. I tried to run my app on win 98 as well as win NT.
Any suggestions?
p.s.
Please, Real answares. Not links to codeguru or codeproject
--EC--
I tried to change font size of CListCtrl object. Unfortunately the row height of the control was not updated, and the text got clipped. I tried to run my app on win 98 as well as win NT.
Any suggestions?
p.s.
Please, Real answares. Not links to codeguru or codeproject
--EC--
ASKER
This article is dealing with owner draw controls. I'm not interesting in drawing the control my self. Is there another way to do that? maybe custom draw?
Use the techniques decribed for WM_MEASUREITEM. I briefly tried out the technique using the dialog's message mapping and it worked fine:
BEGIN_MESSAGE_MAP(CGrantBr owse, CAuxiliaryDialog)
// ...
ON_WM_MEASUREITEM()
// ...
END_MESSAGE_MAP()
void CMyDlg::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
{
if (nIDCtl == IDC_MYLISTCTRL)
lpMeasureItemStruct->itemH eight = 20;
else
CDialog::OnMeasureItem(nID Ctl, lpMeasureItemStruct);
}
There appears to be a way to redirect the measure item message using reflection so that the subclassed control is more usable. Rather than relying on the container window having to resize the control's height.
Good Luck,
Steve
BEGIN_MESSAGE_MAP(CGrantBr
// ...
ON_WM_MEASUREITEM()
// ...
END_MESSAGE_MAP()
void CMyDlg::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
{
if (nIDCtl == IDC_MYLISTCTRL)
lpMeasureItemStruct->itemH
else
CDialog::OnMeasureItem(nID
}
There appears to be a way to redirect the measure item message using reflection so that the subclassed control is more usable. Rather than relying on the container window having to resize the control's height.
Good Luck,
Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.codeproject.com/listctrl/changerowheight.asp
You're going to have to a little reading :)