CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Join Date
    Mar 2000
    Posts
    45

    Resize Row Height of CListCtrl

    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!!!!!!!!!!!!!

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,042

    Re: Resize Row Height of CListCtrl

    You need an ownerdrawn CListCtrl for this. Then just use measureitem. See http://www.codeproject.com/KB/list/changerowheight.aspx for an example.

  3. #3
    Join Date
    Mar 2000
    Posts
    45

    Re: Resize Row Height of CListCtrl

    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?
    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,042

    Re: Resize Row Height of CListCtrl

    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.

  5. #5
    Join Date
    Mar 2000
    Posts
    45

    Re: Resize Row Height of CListCtrl

    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.

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,042

    Re: Resize Row Height of CListCtrl

    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:
    Code:
    void CColoredListReport::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
    {
    	lpMeasureItemStruct->itemHeight = 40; //CDC::gettexte;
    }
    Which is specifying the size of a row.

  7. #7
    Join Date
    Mar 2000
    Posts
    45

    Re: Resize Row Height of CListCtrl

    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.

  8. #8
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    3,153

    Re: Resize Row Height of CListCtrl

    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.

  9. #9
    Join Date
    Mar 2000
    Posts
    45

    Re: Resize Row Height of CListCtrl

    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
    Last edited by seguprasad; March 30th, 2010 at 05:59 AM.

  10. #10
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    3,153

    Re: Resize Row Height of CListCtrl

    Quote Originally Posted by seguprasad View Post
    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.

  11. #11
    Join Date
    Mar 2000
    Posts
    45

    Re: Resize Row Height of CListCtrl

    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||

  12. #12
    Join Date
    Jan 2003
    Location
    Wallisellen (Zürich), Switzerland
    Posts
    16,236

    Re: Resize Row Height of CListCtrl

    Victor Nijegorodov

  13. #13
    Join Date
    Mar 2000
    Posts
    45

    Re: Resize Row Height of CListCtrl

    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

  14. #14
    Join Date
    Jan 2003
    Location
    Wallisellen (Zürich), Switzerland
    Posts
    16,236

    Re: Resize Row Height of CListCtrl

    Sorry, I don't have enough time...
    Victor Nijegorodov

  15. #15
    Join Date
    Mar 2000
    Posts
    45

    Re: Resize Row Height of CListCtrl

    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?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



HTML5 Development Center

Click Here to Expand Forum to Full Width