I have a form that has a combobox . I need this combobox value to remain unchanged even if the user closes and reopens the form. The value should remain constant, unless the user updates it, then the updated field will remain constant.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Then you need to store the selected value somewhere – depending on the lifetime you need to decide where.
If you are closing and opening the entire application then you will need to store the value in a database or file – an xml file may be your best bet.
If you only need to keep it unchanged for the lifetime of the application then you can store it in memory – lets say in a static variable of the form, the following demonstrates that option: