Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

VS 2010 Clone properties of a control

$
0
0
I was wondering if we could clone all the properties of a control to another control (of same type).

For me, I want to clone the properties of the existing textbox to the dynamically created textbox. For that, I would do,

Code:

    Dim newBtn as Button
    Me.Controls.Add(newBtn)

    newBtn = btnExisting

But newBtn starts referencing btnExisting, rather.

And it is pain to newBtn.Property = btnExisting.Property for each property I want to clone.

I look forward for any way to accomplish my objective.

Thanks!

Viewing all articles
Browse latest Browse all 42215

Trending Articles