Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2002
    Posts
    2

    Question Unanswered: Newbies to VB....need help !!!

    Hie,

    I'm new to VB and I'm having a problem regrading delay and label properties.

    My code:

    (current backcolor = vbblue)

    Label1.BackColor = vbRed
    For i = 0 To 10000000
    Next i
    Label1.BackColor = vbblue

    I have one label and I wish to set the back color from blue to red then delay for a while before switching it back to blue.

    I can't get this done as the end result just went to blue without going to red first.

    Please help. I can't find anything on the book.

    Another questions is regrading different label name properties. Let say I have 10 Label, as such from Label1..Label2.....Label10

    Is there a way where I can access different label usng the for loop statement.

    Eg: For x =1 to 10
    Label (x) = 1
    Next i

    I can't get this statement working. Please help.

    Thanks a million....!!!
    Issac

  2. #2
    Join Date
    Jun 2002
    Posts
    18
    Try putting a doevents in between the for i = 0 to and the next. This yeilds control and should allow you to display the colour you want. If you create a control array you can loop through and set them all with a few lines of code. If you need any more mail me

  3. #3
    Join Date
    Feb 2002
    Posts
    2,232
    Using the timer control is a perfect solution here. As for you referencing the labels - make your labels a control array. You can also loop through the controls on your form and check to see if it is a label but in this case the control array is a better solution.

    Good luck.

  4. #4
    Join Date
    Jun 2002
    Posts
    2
    Hi,
    Thanks for all your help, I got the codes working and are learning to use the control array for my labels. Thanks again for your kind reply and coaching..!

    Issac

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •