Results 1 to 5 of 5

Thread: click into listview and enter data

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2008
    Posts
    77

    click into listview and enter data

    is there a way to setup a listview where you can click into one of the fields and enter data?
    Last edited by coder4life; Jun 20th, 2009 at 10:47 PM.

  2. #2
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    804

    Re: click into listview and enter data

    The most common method of achieving this is to float a textbox over the
    individual cells, moving and sizing it to fit the LV cell. There are many
    examples on PSC, and here is one that works fairly well:
    http://www.planet-source-code.com/vb...41097&lngWId=1

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: click into listview and enter data

    If you're only interested in changing the first column then just do this.

    Code:
    Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
    
        ListView1.StartLabelEdit
        
    End Sub

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2008
    Posts
    77

    Re: click into listview and enter data

    what i want to do is pull in a list from a text file, one that keeps changing

    like

    abs vbtab def vbtab ghi vbtab jkl vbtab mno
    123 vbtab 345 vbtab 145 vbtab 222 vbtab 111
    abs vbtab def vbtab ghi vbtab jkl vbtab mno
    abs vbtab def vbtab ghi vbtab jkl vbtab mno

    etc

    ok, so now we see this in the listview

    but i want to revise the item in the 3rd row last column, for example, so i will want to click into that field, change the item and then re-export the revised version to the text file

    if the listview idea doesnt work, is there another way?

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: click into listview and enter data

    Quote Originally Posted by coder4life View Post
    what i want to do is pull in a list from a text file, one that keeps changing

    like

    abs vbtab def vbtab ghi vbtab jkl vbtab mno
    123 vbtab 345 vbtab 145 vbtab 222 vbtab 111
    abs vbtab def vbtab ghi vbtab jkl vbtab mno
    abs vbtab def vbtab ghi vbtab jkl vbtab mno

    etc

    ok, so now we see this in the listview

    but i want to revise the item in the 3rd row last column, for example, so i will want to click into that field, change the item and then re-export the revised version to the text file

    if the listview idea doesnt work, is there another way?
    I assume you can fill the listview from the text file and rewrite it to the text file when done without help, and for the rest, did you look at the code that VBClassicRocks linked to? It works.

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