Results 1 to 6 of 6

Thread: 4 Questions [2 resolved]

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    4

    4 Questions [2 resolved]

    How can I save any information added or deleted from any listbox when the user exits the program?

    How can I make just one line in a listbox turn red with a command button?

    When the X button is pressed how can I make it require a password for the program to quit?

    How can I make a item in a listbox show information in a textbox and listbox? The textbox would contain the users name associated with the item selected. And the listbox would contain what books the user has out including the one they have selected that brings up all this information!



    This would complete my library program, so I thank everyone who will answer ALOT!!!!
    Last edited by FBI_11; Oct 23rd, 2002 at 06:13 AM.
    VB Geek

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    How can I save any information added or deleted from any listbox when the user exits the program?

    ==> Use a database or store the info in a delimited text file or the registry

    How can I make just one line in a listbox turn red with a command button?

    ==> Not easily. Consider using a ListView instead.

    When the X button is pressed how can I make it require a password for the program to quit?

    ==> (A password to exit - VERY unusual) Put code in the form's QueryUnload event. Do a forum search for QueryUnload and you'll find a lot of examples.

    How can I make a item in a listbox show information in a textbox and listbox? The textbox would contain the users name associated with the item selected. And the listbox would contain what books the user has out including the one they have selected that brings up all this information!

    ==> Tex1.text = username & List1.Text

  3. #3
    Fanatic Member
    Join Date
    May 2002
    Posts
    746

    Re: 4 Questions

    Originally posted by FBI_11
    How can I save any information added or deleted from any listbox when the user exits the program?
    You can either save items w/ the registry (although here that would be the poorest choice), a text file, or to a DB.

    How can I make just one line in a listbox turn red with a command button?
    Don't know if you can change font properties for individual elemnts.

    When the X button is pressed how can I make it require a password for the program to quit?
    Query_Unload Event

    How can I make a item in a listbox show information in a textbox and listbox? The textbox would contain the users name associated with the item selected. And the listbox would contain what books the user has out including the one they have selected that brings up all this information!
    Add Method

  4. #4
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Toronto, Ontario
    Posts
    280
    Originally posted by MartinLiss

    ==> (A password to exit - VERY unusual) Put code in the form's QueryUnload event. Do a forum search for QueryUnload and you'll find a lot of examples.
    In the Form_QueryUnload event, put some sort of a prompt to enter the password then:

    if password = correct then
    cancel = vbFalse
    else
    cancel = vbTrue
    end if

  5. #5

  6. #6
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    Mr. FBI,
    just in case you couldn't figure it out here's a quick sample project excluding ForeColor for individual items (use Aaron's snippet code). So check attachments and enjoy it.
    Attached Files Attached Files
    Roy

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