Results 1 to 2 of 2

Thread: Listboxes and passing back and forth

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Question

    I have 2 listboxes one is lstSourceFiles and the other is lstSelectedFiles. lstSourceFiles contains filename, pgsize and pgnum. When a file in lstSourceFiles is selected the filename is passed to lstSelectedFiles box and the pgsize and pgnum get discarded. What I want to be able to do is store the pgsize and the pgnum in a variable so that if/when the file in lstSelectedFiles box gets passed back or removed it will contain the pgsize and pgnum again. lstSelectedFiles also adds up the pgsize and right at the moment when the file is selected and removed I can not subtract the pgsize as I no longer have this value. I know that I can reopen file and get the pgsize and pgnum, but this takes a fair bit of time and slows the program. Does anyone have any thoughts on how to do this, so that the pgsize and pgnum are kept??

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    You can store the ListIndex of lstSourceFiles (or the pgsize itself if that's all you need) in the ItemData property of lstSelectedFiles. If you are not aware, ItemData can be used like an invisible column.

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