Notifications
Clear all
[Closed] ClassOf dotNetControl
Jun 25, 2008 12:55 am
Is there a way to find out if a rollout control is infact “System.Windows.Forms.Button” ? It would be similar to trying to figure out if an object is sphere:
if (classOf obj) == sphere do print “Is a sphere”
2 Replies
Jun 25, 2008 12:55 am
Sure:
TestCtrl = dotNetObject "System.Windows.Forms.Button"
dotNetObject:System.Windows.Forms.Button
CtrlType = dotNet.getType TestCtrl
dotNetObject:System.RuntimeType[System.Windows.Forms.Button]
CtrlType.Name
"Button"
CtrlType.Namespace
"System.Windows.Forms"
CtrlType.IsInstanceOfType TestCtrl
true
show CtrlType shows all available properties.
Cheers,
Martijn