1

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?

4

1 回答 1

2

不,您不能将属性动态添加到Control. 您可以使用控件的现有Tag属性:

circle1.Tag = 1

不幸Tag的是,它是类型Object,因此您将不得不Nothing在检索它时检查和/或转换该值。

于 2013-11-12T21:38:45.860 回答