Results 1 to 11 of 11

Thread: sourse code About list box...

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    14

    sourse code About list box...

    I want to create a list box.I drag one list box and one command button whick is called "GO". For example inside the list box have 5 item,when i chose one of these and click GO.The form about the item wil show.Now i am facing the problem in writing the code when click the item to call out the related form. Can anybody help me here?Thank.Urgent.Thanks first.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: sourse code About list box...

    Moved from the CodeBank

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    14

    Re: sourse code About list box...

    What you mean "Moved from the CodeBank"?Have any website related what i want to recommend to me?Thanks.

  4. #4
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: sourse code About list box...

    You have to post in the Classic Visual Basic Forum.But you werent.You have posted in the codebank.Brief your requirements
    Please mark you thread resolved using the Thread Tools as shown

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: sourse code About list box...

    Will a different form be called depending on the listbox selection, or will the same form be called, but have different settings based on the listbox selection?

  6. #6

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    14

    Re: sourse code About list box...

    For the different item i click,different form will call.So how I need to do?Thank.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: sourse code About list box...

    What's in the list box? The name of the form to be called or something else?
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: sourse code About list box...

    Code:
    Select Case List1.Text
           Case "Listbox Item 1"
              Form1.Show
           Case "Listbox Item 2"
              Form2.Show
           Case "Listbox Item 3"
              Form3.Show
          Case "Listbox Item 4"
              Form4.Show
           Case "Listbox Item 4"
              Form5.Show
           Case Else
              Msgbox "You must select something from the list."
    End Select
    Replace the text in the Case statements with what is in your listbox and the form names with the names of the forms you are using.

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: sourse code About list box...

    Please check your PMs

  10. #10

    Thread Starter
    New Member
    Join Date
    Dec 2006
    Posts
    14

    Re: sourse code About list box...

    Inside the list box,i will put the component like screw,nut,bolts and machine screw.what you mean of replace the text in the Case statements?

  11. #11
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: sourse code About list box...

    Quote Originally Posted by yanlin
    Inside the list box,i will put the component like screw,nut,bolts and machine screw.what you mean of replace the text in the Case statements?
    Did you see my example?

    I didn't know what was going to be in your listbox, so I made something up.

    When you write that code, replace my text with yours.

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