Results 1 to 3 of 3

Thread: Small Tip Asked

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Worldwide in the Sun
    Posts
    566
    Hi Guys,

    I have a form with 240 shape objects.
    It is a control panel simulation.
    So we have shape1.backcolor = rgb(0,0,0)
    until shape240.backcolor = rgb(0,0,0)
    Isn't there a shorter way to code instead of typing
    240 lines.
    Think about something as a loop.
    Tried a few things but seems not to work.


    Thanks for your time
    Ray
    Ray

  2. #2
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    258
    Look into "collections"

    Code:
     For Each c In Me.Controls
            If TypeOf c Is TextBox Then
               c.BackColor = frm_Main.SkinForm1.SkinSource.ClrWindow
                c.ForeColor = frm_Main.SkinForm1.SkinSource.ClrWindowText
            End If
        Next
    []P
    Visual Basic 6 SP4 on win98se

    QUIT THE RAT RACE BECAUSE YOUR MESSING THE WORLD UP !!!!!

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Worldwide in the Sun
    Posts
    566
    To Private1

    Thanks for the code

    Works fine.

    Cheers
    Ray
    Ray

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