Overt_Agent
Overt_Agent

Reputation: 519

Can I store a variable in an object?

Say I have a form application, and I draw a circle inside of it. Could I store a variable inside that circle object? Something like this?

Dim circle1.testVar As Integer = 1

Would that work, and is there a way to do this if it won't?

Upvotes: 1

Views: 67

Answers (1)

D Stanley
D Stanley

Reputation: 152566

No, you cannot dynamically add properties to a Control. you can use the existing Tag property of a control:

circle1.Tag = 1

Unfortunately Tag is of type Object so you're going to have to check for Nothing and/or cast the value when you retrieve it.

Upvotes: 2

Related Questions