Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
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?
不,您不能将属性动态添加到Control. 您可以使用控件的现有Tag属性:
Control
Tag
circle1.Tag = 1
不幸Tag的是,它是类型Object,因此您将不得不Nothing在检索它时检查和/或转换该值。
Object
Nothing