CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 1999
    Location
    Sweden
    Posts
    15

    Listview: Icon on the left or on the right...

    I want to mimic Outlooks mailclient uses icons in the columnheader when you click on them to sort.

    How do I go about placing the icon on the right side of the text. I've tried the different alignment options given, but that only seem to affect the placement of the text leaving the icon stuck to the left.

    TIA

    //Patrik





  2. #2
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    Re: Listview: Icon on the left or on the right...

    There is a free OCX with source code that emulate the OUTLOOK list view at www.wbAcceleretor.com.
    Look at this Web site in the VB section there are a lot of examples.


  3. #3
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    Re: Listview: Icon on the left or on the right...

    There is a free OCX with source code that emulate the OUTLOOK list view at www.vbAcceleretor.com.
    Look at this Web site in the VB section there are a lot of examples.


  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Listview: Icon on the left or on the right...

    I dont know how you are doing: Here is a piece of code that does that. Taken straight from a project: so i hope you will understand the missing links:


    ' Sets the ListView header image. It is assumed that a listview is tied to a Image
    ' list control from which it will pick up the images.
    ' Inputs: lvHwnd : Hwnd parameter of a Listview control
    ' iColumnid : 0-based Column index. First column = 0 .. etc
    ' iImageIndex: 0-based index into the images of the imagelist control
    ' tied to the list view
    public Sub SetLVHdrImage(byval lvHwnd as Long, _
    byval iColumnid as Long, byval iImageINdex as Long)
    Dim lrtn as Long
    Dim plvcolumninfo as LVCOLUMN

    plvcolumninfo.mask = LVCF_IMAGE + LVCF_WIDTH
    lrtn = SendMessageAny(lvHwnd, LVM_GETCOLUMNA, iColumnid, plvcolumninfo)

    With plvcolumninfo
    .mask = LVCF_IMAGE + LVCF_FMT
    .iImage = iImageINdex
    .fmt = LVCFMT_IMAGE + LVCFMT_BITMAP_ON_RIGHT
    End With
    lrtn = SendMessageAny(lvHwnd, LVM_SETCOLUMNA, iColumnid, plvcolumninfo)

    End Sub





    RK

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured