Results 1 to 4 of 4

Thread: ListView Column [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member Mindcrime's Avatar
    Join Date
    Jun 2001
    Location
    Peterborough, UK
    Posts
    555

    ListView Column [RESOLVED]

    I want to return the column from a ListView the user has selected from a right mouse click event.

    Does anyone know how to do this?

    Cheers
    Last edited by Mindcrime; May 11th, 2005 at 08:42 AM.
    Mindcrime : )
    ICQ 24003332

    VB 5.0, VB 6.0 SP5, COM, DCOM, VB.NET Beta 2, Oracle 8

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    Re: ListView Column

    See the last example on this page:
    http://www.thevbprogrammer.com/index...ter=13&Topic=1
    "It's cold gin time again ..."

    Check out my website here.

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: ListView Column

    When you add the items under the columns, set their tags to the columns owners..then use a HitTest:
    VB Code:
    1. Private Sub ListView1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
    2. If Button = 2 Then
    3.     Dim lvi As ListItem
    4.     Set lvi = ListView.HitTest(x, y)
    5.     MsgBox lvi.Tag
    6.     Set lvi = Nothing
    7. End If
    8. End Sub
    That's about the only way I know of.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4

    Thread Starter
    Fanatic Member Mindcrime's Avatar
    Join Date
    Jun 2001
    Location
    Peterborough, UK
    Posts
    555

    Re: ListView Column [RESOLVED]

    Thanks BruceG, works a treat.

    ...now to get that column width.

    Mindcrime : )
    ICQ 24003332

    VB 5.0, VB 6.0 SP5, COM, DCOM, VB.NET Beta 2, Oracle 8

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