Results 1 to 5 of 5

Thread: clearing an array

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    I got a control array (shape one) now how do I clear the whole thing? there are 15 of those shapes
    NXSupport - Your one-stop source for computer help

  2. #2
    Guest
    What do you mean, "clear"? You mean, not visible?
    Code:
    For i = 0 to 15
    Shape1(i).Visible = False
    Next

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    yea and I also have an array of labels, do I do the same thing, but make it .caption = "" instead of .visible = false


    P.S. I was thinking of a label when I was posting it (becuase I need it for a label and a shape) thats why I wrote clear
    NXSupport - Your one-stop source for computer help

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    If you mean unload it works like this.
    Code:
    Private Sub Command2_Click()
        Dim intcre As Integer
        'you always leave the index(0) of an array loaded
        For intcre = 1 To 14
           Unload Shape1(intcre)
        Next intcre
    
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    Guest
    Same thing, isn't very hard:

    Code:
    For i = 0 to 15
    Label1(i).Caption = ""
    Next
    You can also do it this way:

    Code:
       For Each MyControl In Me.Controls
        If TypeOf MyControl Is Label Then MyControl.Caption = ""
       Next

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