How to add a winform to grasshopper and import the parameters entered in the winform to the grasshopper sychronously?

I am developing a gha. When the customized batery is called, a winform will be displayed. Then I input some parameters into the winform, and click a OK button, then the parameters will be import into the gh file, and a object will be built in rhino. Now I want to change the parameters in the winform, and the shape of the object will be change when I click the OK button again. How can I realize it?
I think that the OK button should trigger an event of the gh. But how?

Assuming your Form pops up due to a UI event (say a double-click on the component, or a context menu item click) and is therefore outside any running solution (if this is not the case, let me know because something will go terribly wrong), you have to expire the component/parameter your form belongs to. This means your Form must have an instance of that object, and inside the OK button click handler you call parentObject.ExpireSolution(true). Presumably before you do that however you have to send your new values from the Form into your object.

1 Like

Thank you very much, the " Expiresolution" indeed works.