Hello!!
Can anyone know : How to resize row height of CListCtrl based on data so that data can be adjusted in row?
It Very Very URGENT!!!!!!!!!!!!!
Printable View
Hello!!
Can anyone know : How to resize row height of CListCtrl based on data so that data can be adjusted in row?
It Very Very URGENT!!!!!!!!!!!!!
You need an ownerdrawn CListCtrl for this. Then just use measureitem. See http://www.codeproject.com/KB/list/changerowheight.aspx for an example.
Marc,
I have sent to you one project that one related to Print Preview. In that project only i do want to increase row height.
I have already been to your posted link but i did not get success..
Can you please look in to my sent project?
I don't have time to look at it in depth.
You need to owner draw the listctrl.
Unfortunately, owner drawing can be complicated.
See: http://www.codeguru.com/Cpp/controls...icle.php/c949/ for an example on how to ownerdraw. Once you understand that, you can handle wm_measureitem to change the height of the rows.
Marc,
It is OK. if by chance if you get sometime then do have a look on my attachment.
i will have a look on your attached link.
Thanks anyways.
I took a quick look, I'm confused.
You are already using owner drawing, so I don't see the problem...
In your code you have the following piece:
Which is specifying the size of a row.Code:void CColoredListReport::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
{
lpMeasureItemStruct->itemHeight = 40; //CDC::gettexte;
}
Marc,
This is fixed size of the row. but suppose if one row contains 2 lines and another row contains 5 line then for first one we will aable to see all lines with extra space and for another one we will able to only 3 lines.
So i do want to set row height at runtime based on the number of lines in row so that we can see all lines for a particular row without extra spacing between rows.
Unless I'm missing something... a ListControl cannot have variable sizes per item. All the items have the same size.
A listbox can have variable size items, but then you'll miss out on a lot of features that are present in a listcontrol.
OReubens,
We can resize all row's height in list Control. Please do have a look on attached link.
http://www.codeguru.com/Cpp/controls...icle.php/c1013
I don't know what you're aiming at, but nothing in that post seems to indicate that rows of varying heights is possible. Quite the opposite even several people are asking for it, but don't get an answer.
As an affirmation. THe measure item message does NOT provide the item it's trying to size, it's only giving a single ID (the ID of the control). So how would you expect to size individual items when the function called to provide the heights doesn't even know what item it's referring to.
It's possible I'm wrong, but there's a lot more evidence proving my point than there is to proove variable row heights are possible in a listcontrol.
Ok, OReuBen. I will work on it and let u know.
Tel me one thing is there any control which can create 4-5 column with multliple line in a row?
Sample::::
----------------------------------------------------
Col 1 | Col 2 | Col 3 | Col 4 | Col 5 | Col 6|
__________________________________
C1R1 | C2R1 | C3R1 | C4R1 | C5R1 | C6R1|
__________________________________
C1R2 | C2R2 | C3R2 | C4R2 | C5R2 | C6R2|
__________________________________
C1R3 | C2R3 | C3R3 | C4R3 | C5R3 | C6R3|
__________________________________
C1R4 | C2R4 | C3R4 | C4R4 | C5R4 | C6R4|
__________________________________
Note: CxRy can be multiline.
If you do know, please do let me know||
Victor,
If you do have some time, can you have a look on my attached project which i had attached earlier. If there is some thing can you let me know.
I will once again look into your sent link though i have already looked into it but did not get success
Sorry, I don't have enough time...
Victor,
In your sent link, it is creating multiline using Cwnd. But I have to use CFormView and over CFormView, I have to use CListCtrl.
Is ther any way to create multiline row in CListCtrl?