CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2001
    Posts
    9

    ListView - selecting first item in list causes rename

    I have an application with several Listview controls on it, in report view containing a few columns of data.

    The application requires selecting some items in the ListView and adding them to another Listview.

    My problem is that when the first item in the ListView is selected (only for the first item) It tries to let you rename the item, rather than merely selecting it.

    Does anyone know if there is a way to stop this from happening?????


  2. #2
    Join Date
    Aug 2000
    Location
    Ottawa, Canada
    Posts
    469

    Re: ListView - selecting first item in list causes rename

    In design mode: right click on your ListView -> Properties -> General tab -> LabelEdit field should be set to Manual.


  3. #3
    Join Date
    Mar 2001
    Posts
    9

    Re: ListView - selecting first item in list causes rename

    Thanks - it worked perfectly. Brilliant!!!


  4. #4
    Join Date
    May 2001
    Location
    Canada
    Posts
    182

    Re: ListView - selecting first item in list causes rename

    If you do it from code:
    ====
    Private Sub ListView_BeforeLabelEdit(Cancel As Integer)
    Cancel = True
    End Sub
    ====

    Regards,

    Michi

  5. #5
    Join Date
    Aug 2001
    Posts
    2

    Re: ListView - selecting first item in list causes rename

    In design mode, right-click on the ListView, select Properties...
    Change the LabelEdit property from 0-lvwAutomatic to 1-lvwManual.
    Note, you may also want to click the checkbox to the right to set FullRowSelect.


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