How to create and listen to a button (in Component Properties Windows) via .net?
Please, Help ![]()
Any suggestions?
If you just want a simple button, you can add a button property (IButtonProperty) to the component and register to its OnClick event.
@TSy, Could you please give an example on how to implement that?
What i’ve tried so far, but did not work:
ISimComponent comp= e.Component.RootNode.Component;
IButtonProperty button = (IButtonProperty)comp.CreateProperty(typeof(ButtonType), PropertyConstraintType.NotSpecified, "myButton");
IProperty<ButtonType> button = (IProperty<ButtonType>)comp.CreateProperty(typeof(ButtonType), PropertyConstraintType.NotSpecified, "myButton");
I’m currently also stuck with creating a simple button from the .net api.
Does anyone have a small example how to achive this?
This works,
var button = (IButtonProperty)comp.CreateProperty(typeof(IButtonProperty), PropertyConstraintType.AllValuesAllowed, "btn");
1 Like