CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: list view ?

  1. #1
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890

    list view ?

    does anyone have an idea how to select listview subitems
    when click.
    like highlight and stuff like that

    Paresh

  2. #2
    Join Date
    Aug 1999
    Location
    Romania, Bucharest
    Posts
    253
    int nStart = X ;
    int spos = 0 ;
    int epos = this.Columns[0].Width ;
    for ( int i=0; i < this.Columns.Count ; i++)
    {
    if ( nStart > spos && nStart < epos )
    {
    subItemSelected = i ;
    break;
    }
    spos = epos ;
    epos += this.Columns[i].Width;
    }
    Console.WriteLine("SUB ITEM SELECTED = " + li.SubItems[subItemSelected].Text);
    subItemText = li.SubItems[subItemSelected].Text ;

    this should give you the selected subitems
    than you have to chenge the background

    let me know if this help

  3. #3
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    thanks Valentin Rozescu,

    I got it working..

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