I have two questions here. First of all, how do I enable selection of multiple listbox items and select them via code?
Secondly, how do I prevent the user from selecting multiple lines?
Now, for some background and my thoughts. I'm working on a project for computer science in which 'movies' (a class module I created) may be borrowed, browsed or requested. Currently, I have it to the point where a user may register or login and their information is saved to a file. I also have the menu after the login screen complete and they can view each and every movie and make requests/borrow them by outputting the information into listboxes.
Each request/borrowed movie is stored into a multi-dimensional array which contains the date and movie's index (I declared an array of movies). Essentially, I want to output the multiple pieces of data for each request as one single listbox item which may be selected and removed from the list as necessary. After a bit of googling and dabbling, I discovered much to my dismay that visual basic 6 list boxes --my CS class uses outdated software >.<-- do not support displaying one list object across multiple lines. As such, I have resorted to the following:
Call lstRequests.AddItem(movStock(requested(0, i)).title) Call lstRequests.AddItem(requested(1, i)) Call lstRequests.AddItem("")
In order to remove a request, I simply need to use modulo 3 (with some minor modifications) on the listIndex (selected item). This is fine and all, however, I don't want the following to happen (bold is the selection):
What I would like to happen is that the entire entry is automatically and instantaneously selected when the user selects one line. As soon as this selection is complete, I would like the list box to return to single line selection so that the user cannot make multiple selections however, I also want the multi-line selection to remain visible. Namely, I must know how to toggle multi-line selections and also how to choose them using code (please, no VB.NET because my CS class uses outdated VB 6).
Thank you very much for taking the time to read this, and hopefully you can help me surmount this obstacle. Besides this, I am absolutely certain I can figure the rest out considering that I've already surpassed the courses expectations by dealing with files and classes. Once again, thank you for your time, as I know this is a relatively trivial distraction relating to an outdated language.