Results 1 to 5 of 5

Thread: List Box Hiding All help

  1. #1

    Thread Starter
    Hyperactive Member scsa20's Avatar
    Join Date
    Apr 2001
    Location
    Mars
    Posts
    456

    List Box Hiding All help

    yeah, this one dude needs help hinding all of his List boxes in one line...ok, he wants it showing only 1 list box while hiding all the other ones (which is 47 list boxes), and when the user clicks on a button, it well hide that one list box and show all the other list boxes.

    is it possable?? and if it is, what is the code??


    p|-|34|2 /\/\3 f0|2 | $p34k 1337
    My TSS quote of the day: "If your haveing a bad day, just press the restart button."

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    what one line of code?
    -= a peet post =-

  3. #3
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    Make an array of listboxes then:
    VB Code:
    1. Private Sub Button_click()
    2. Dim i as Integer
    3.  
    4. For i = 0 to 46 'all listboxes
    5.     If i = 4 'the one that you want to show then
    6.         List1(i).Visible = True
    7.     Else
    8.         List(i).Visible = False
    9.     End If
    10. Next
    Is this what you mean?
    seoptimizer2001
    VB 6.0, VC++, VI, ASP, JavaScript, HTML,
    Perl, XML, SQL Server 2000

    If God had intended us to drink beer, He would have given us stomachs.


    Please use the [code] and [vbcode] tags in your posts!
    If you don't know how to use them please go HERE!


  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    assuming one is visible at start, and the rest not visible or visa versa u can use this

    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim c As Control
    3.     For Each c In Me
    4.         If TypeOf c Is ListBox Then c.Visible = Not c.Visible
    5.     Next c
    6. End Sub
    -= a peet post =-

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    ?? u don't make much sence today ?? what are u on about?
    -= a peet post =-

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