Results 1 to 8 of 8

Thread: Listview Problem

  1. #1

    Thread Starter
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Listview Problem

    When I click the columnheader of a listview, maybe a listitem or a subitem, I want to to select all items on the column and maybe have a right click menu with copy options.

    Can somebody guide me with this. I've done some searching but failed.

  2. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: Listview Problem

    Put a PopupMenu on the ListView1_MouseDown event.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  3. #3

    Thread Starter
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Listview Problem

    Yes, but how can I select all the entries on the columns just by clicking it's column headers? Is this possible?

  4. #4

    Thread Starter
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Listview Problem

    Ok now I had additional problems. How can I copy the contents of a listview submenu? And another question, is it possible to highlight the submenu? coz it only highlights the listitem.

    Wow I realized that im so noob with listview.

    Any ideas? or maybe I should change to FlexGrid instead?

  5. #5
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: Listview Problem

    What are you calling submenu? Are you talking about each item in the columns? That is ListView1.SelectedItem.SubItems(1) 1 is the number of columns.

    Quote Originally Posted by zynder
    coz it only highlights the listitem
    It depends which ListView you are using. Comctl32.ocx when you select an item in the first column, only that item will be highlighted. Msomctl.ocx when you select an item in the first column all columns will be highlighted in the same row.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  6. #6

    Thread Starter
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Listview Problem

    Sorry I mean SubItem not submenu. Is there any way I can only select the column I wanted?

    Say I clicked the column headers of a subitem. Is it possible to highlight all entries of the selected column?

  7. #7
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Listview Problem

    Depends... normaly, no. ListView allows selecting only first column. But... you can sub-class it. Search the forums. You'll find many examples.

  8. #8

    Thread Starter
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Listview Problem

    I can't find samples. Well, im no good at subclassing either.. Thanks for the reply gavio. I will switch to datagrid for now.

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