Groups | Blog | Home
all groups > dotnet general > march 2004 >

dotnet general : How to reference a control which was added programmingly



william
3/31/2004 9:21:08 PM
Hi, everyone

After adding a control into a container like form using form.controls.add(myControl), how could I reference it
For example
dim aControl as new butto
me.controls.add(aControl

then I want set backcolor of this button, how

Thanks

Gary Milton
4/1/2004 7:55:56 AM
\\\
Dim aControl As New Button

Me.Controls.Add(aControl)

aControl.BackColor = Color.Blue
///

HTH,
Gary

[quoted text, click to view]

APG
4/1/2004 12:33:50 PM
Hi William,

You can use the same button object till it is within scope. For example,

Dim aControl As New Button
Me.Controls.Add(aControl)

aControl.BackColor = Color.AliceBlue

HTH.

[quoted text, click to view]
AddThis Social Bookmark Button