CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    NOVICE: List Control selecting a row...

    Hi,

    I have a list control, and I have an option to refresh the datas on it ( delete all and put new datas), but I would like to keep on select the text row that was selected in the list control before.

    I have tried to do this ( in a loop..., while I'm inserting...):

    if (iOldSelected!=-1 && IEAdr == OldAdrSelected) {
    m_lcImportantIE.SetItemState(iIndex,LVIF_STATE,LVIS_FOCUSED|LVIS_SELECTED);
    iOldSelected = -1;
    }

    But don't works, anybody can help me ?, Thanks, Bye !
    Braulio


  2. #2
    Join Date
    Apr 1999
    Posts
    306

    Re: NOVICE: List Control selecting a row...

    Why don't you finish the loop and then select whatever you want.


  3. #3
    Join Date
    May 1999
    Location
    Spain
    Posts
    335

    Re: NOVICE: List Control selecting a row...

    I have putted this, and now works:

    m_lcImportantIE.SetItemState(iIndex,LVIS_FOCUSED|LVIS_SELECTED,
    LVIS_FOCUSED|LVIS_SELECTED);


    Is better to do it while I'm inserting the items, because then I only made one loop not too ( to find the text in the row...).

    Bye !
    Braulio


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