Results 1 to 5 of 5

Thread: ListView Control

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    4
    I need a code example for this question. I have a ListView control and a text box on my form, set up like you would see in most e-mail clients with the list of messages up top and a preview pane below, and when you click on a row in the listview it shows the message in the preview pane.

    If my user edits the text in the text box, I want to prompt them to save before they move to another "message". How would I write the validation code for this?

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Do you have the text stored in a text file or dynamicly in the code? If it's a text file then simply Have a msgbox pop up asking if the user wants to save. Then if vbYes is clicked then write the new info into the textfile.
    Code:
    Open "test.txt" For Output As #1
        Print #1, Text1.Text
    Close #1
    Hope that somehow helps,
    D!m
    Dim

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    4
    But when a user goes from one line to another, how do I have it run validation code for the record (line)?

  4. #4
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    Admittedly, I have very little experience with the ListView control, but it would make sense that you could probably put your validation code inside of the Itemchecked event. This would run when an item in the listview is selected. So all you would have to do is place the previously checked item's listindex into a global variable (or better yet, property), and then use it to run your validation code. I hope this is useful. Any other ideas?


  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    4
    I actually think that doing that will work, but if there are any more ideas, I would greatly appreciate them.

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