I am writing my own possizer, now I got a problem that my value in the textbox is keeping the same when i revisit this possizer, but the checkbox isn't. I found that the official Possizer, e.g "Position Options", the <max open positions> button (checkbox) keeps checked once clicked.
May I ask how to do so? As I don't want to re-check the box every time for just changing part of the value in my possizer.
Thanks
Size:
Color:
Check out the
API Guide on creating PosSizers, and you shall find the answer under "
Persisting Custom Settings".
Make sure you downloaded the
MS123.PosSizers demo solution from the Wiki that demonstrates how to use ICustomSettings to persist the state of all GUI input elements.
Size:
Color:
Yes, I did see this part and edited my own which bases on the demo. Here are the code:
CODE:
Please log in to see this code.
this._max_open_checked is the bool which holds the value for the checkbox. And my possizer inherits from "BasicPosSizer".
But only the textbox value is kept, not the checkbox.
Size:
Color:
Keep in mind that this is just a part of the puzzle.
Like the included ScriptBasedPctEq.cs class illustrates, your PosSizerSettingsBase (when your PosSizer derives from BasicPosSizer) or your UserControl (when inheriting from PosSizer) must have a property to set/get the checkbox state.
Size:
Color:
Yes, I successfully did it as you told me, thank you Eugene.
Size:
Color: