Results 1 to 8 of 8

Thread: [RESOLVED] List box + button help

  1. #1

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Resolved [RESOLVED] List box + button help

    I currently have a List Box that, when an item is clicked, the information that I have written for it is displayed in a text box below it,

    Code:
    If List1.SelectedIndex = 0 Then
                Text1.Text = "Test"
             End If
    I wanted to know if I could do the same thing with buttons. So, if I were to click on the list item with value "0", I want a specific button to show up. Or item value "1" and a different button takes it's place. I think you all understand where I'm going with this.

    I thought that I could use the same thing, but instead of Text1.Text, maybe an indicator linking the button. I just wasn't sure how to do that or if that needed to happen.

    Thanks
    Last edited by weirddemon; Jan 5th, 2009 at 01:17 AM.

  2. #2
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: List box + button help

    Put a button on the form and set it to visible = false in the properties window

    Code:
    If List1.SelectedIndex = 0 Then
              me.Button.Visible=true
             End If

  3. #3

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: List box + button help

    Ah. Just reading your code, I saw that you are right and it makes perfect sense now.

    Thank you very much


  4. #4

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: List box + button help

    I have one more problem.

    Is there a way to hide the button again once I click another item in the list or something along those lines?

  5. #5
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: List box + button help

    Code:
    If List1.SelectedIndex = 1 Then
              me.Button.Visible=FALSE
             End If

  6. #6

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: List box + button help

    Thanks again. I guess I just need to think outside the box :P

  7. #7
    Frenzied Member toecutter's Avatar
    Join Date
    Apr 2006
    Location
    Brisbane, Australia
    Posts
    1,160

    Re: [RESOLVED] List box + button help

    Couple of good learning aids

    My Learning Path
    http://msdn.microsoft.com/en-au/beginner/bb308760.aspx

    Provided By obi1kenobi
    http://www.homeandlearn.co.uk/

  8. #8

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: [RESOLVED] List box + button help

    Thanks for the info

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