right now all my forms with input textbox once you close the form upon running the program in civil 3d or autocad and start the command to show the form again resets to default windows form values set in visual studio. what's the easiest way to have the last user input value stay there each time you run the form again?
before i done this using "settings" in visual studio which stores and retrieve property settings. but it's a little annoying to set one by one.
some guy answered and then removed the answer.
no i mean to retain values in the text box like input of length, radius, stuff like which is used for calculations. user wants to be able to run the form again with the last input.
anybody?
I removed my post because I misread your question and therefore provided a useless answer.
I would just use a singleton class, structure, or object array/list/dictionary. Just create it with your default settings preloaded, then when the form first loads, pull your values from it. When the form closes, write the values back to it. Next time the form opens during the session, since the singleton already exists, your form will populate with the previously stored values.
The code to do what you want may be found in the source code for the free version of the SincPac. It either saves to the drawing or to the registry and then you pull the values from it. This way it stays around. You can also create a singleton like was previously mentioned to store the values and when the form is created pull the values from it.
As Chris suggested, a singleton will only store value for the current session of AutoCAD/Civil 3D (since that's what you specified in your title).
If you were previously using the application settings route through visual studio, those are typically persistent settings (except they are reset every time the host application version changes) and can be retrieved between sessions. A singleton will not replicate that functionality. Kean has a few posts covering saving data in the registry and drawings. I believe the SincPac settings utilize most of these ideas.
thanks guys. i end up using the settings. wans't too bad.
singleton that is news to me. definitely look into that later.
see picture of what i did.