Results 1 to 5 of 5

Thread: [2005] Listbox Validation

  1. #1

    Thread Starter
    Addicted Member Abrium's Avatar
    Join Date
    Feb 2007
    Location
    The Great State of Texas
    Posts
    205

    Exclamation [2005] Listbox Validation

    Hey all,

    What is the best method for listbox validation? I have three list boxes and I'm trying to use the sub listbox with declaration validating. I have this code written but its not quite functioning like it would with a text box. I need a way to clean my code up because I have a ton of if...then statements trying to validate that an index has been selected or there is a value in a listbox.

    "If LisWorkShop.SelectedIndex = -1 Then
    MessageBox.Show("Workshop")
    e.Cancel = True
    Else
    e.Cancel = False End If"


    I'm just looking for a beginners way to streamline listbox validation

    Thanks
    Abrium
    Asking the beginners questions so you don't have to!
    If by chance hell actually froze over and I some how helped you... Please rate.

  2. #2
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: [2005] Listbox Validation

    Can you post all of your code? The code you gave above doesn't appear to go together..... at least I hope you don't have it all together...
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  3. #3

    Thread Starter
    Addicted Member Abrium's Avatar
    Join Date
    Feb 2007
    Location
    The Great State of Texas
    Posts
    205

    Re: [2005] Listbox Validation

    How does that not go together, that is a validating sub to insure validation before focus shifts to another control.
    Abrium
    Asking the beginners questions so you don't have to!
    If by chance hell actually froze over and I some how helped you... Please rate.

  4. #4

    Thread Starter
    Addicted Member Abrium's Avatar
    Join Date
    Feb 2007
    Location
    The Great State of Texas
    Posts
    205

    Re: [2005] Listbox Validation

    The text in the message box is just test text to ensure that it works properly
    Abrium
    Asking the beginners questions so you don't have to!
    If by chance hell actually froze over and I some how helped you... Please rate.

  5. #5
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: [2005] Listbox Validation

    so..... back to my question, can you post your code? It's simple, no code, no idea.
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

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