Hi. I can write checkbox and TextBox configuration to richtextbox with this code.
Question: how can i save checkbox and textbox configuration to .txt file and then load from .txt file?
Hi. I can write checkbox and TextBox configuration to richtextbox with this code.
Question: how can i save checkbox and textbox configuration to .txt file and then load from .txt file?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tuhin PaulPosted Mar 4, 2023, 9:48 PM
Yes, you can save the configuration of checkboxes and textboxes to a .txt file and then load it from the same file. Here is an example code snippet that demonstrates how to do this, you can take reference from here:
In the SaveToFile method, it iterates over all controls in the Control.ControlCollection and writes the name and value of each CheckBox and TextBox control to the specified .txt file. In the LoadFromFile method, it reads the name and value of each control from the .txt file and updates the corresponding control in the Control.ControlCollection.
Tuhin PaulPosted Mar 7, 2023, 1:28 AM
@Vusal, thanks!
Vusal MastaliyevPosted Mar 4, 2023, 7:34 PM
That's how I heard