Link to home
Start Free TrialLog in
Avatar of David11011
David11011Flag for United States of America

asked on

Set properties for multiple objects at once

I'm building this website that has A LOT of labels and textboxes. I'm wondering if there is a way to set properties for dynamically added controls.

Example of what I'm trying to say:
Dim label1 as New Label
Dim label2 as New Label
Dim label3 as New Label

With label1, label2, label
      .Font.Name = "Arial"
      .Font.Size = 9
      .ForeColor = System.Drawing.ColorTranslator.FromHtml("#333333")
      .Font.Underline = True
End With

label1.ID = "lbl1"
label1.ID = "lbl2"
label1.ID = "lbl3"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of disrupt
disrupt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
have a look at this page... there is a function to clone a control...
so you create one, set properties athen clone it to create others :P

http://forums.asp.net/t/617980.aspx
Avatar of David11011

ASKER

Exactly what I was looking for. Thanks