Notifications
Clear all

[Closed] ClassOf dotNetControl

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

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

Thanks, Martijn, appreciate it.