Hi
I have multiple comboBoxes each populates same options.
For example:
string[] Items = { "Name", "ID", "Country", "Address", "Age", "Gender" };
string[] mySelectedItems = new string[4];
In the form_load
{
Cb1.Items.AddRange(Items);
Cb2.Items.AddRange(Items);
Cb3.Items.AddRange(Items);
Cb4.Items.AddRange(Items);
SelectedItems[0] = Items[1];
SelectedItems[1] = Items[0];
SelectedItems[2] = Items[2];
SelectedItems[3] = Items[5];
}
If I selected different option from each comboBox, Lets say:
Country from cb1 , Name from cb2 and ID from cb3.
Then, If I'd like to save this current selections to be used like a default settings whenever my application runs next time. then maybe I need to save the selection on array and in the forom_load I'll set a condition to run one of those two settings. But what is the condition on this case?
Or maybe i need to save the current settings and give a name for the setting, and when I need to use this setting, I just need to select the name and press on load button.
for this, where to save the selection and give a name so that I can load later? Do I need a DB? Still beginner in coding.
Javeed M ShaikhPosted Sep 8, 2013, 7:33 PM
Hind NajimPosted Sep 7, 2013, 1:48 AM
Thanks for the help. I got the idea..
But, I have a question, If I want to send my exe file to another user so that he can work on it also, will this work on his computer as well? lets say if I create in my project/form 3buttons, one for the default settings, one for the store settings and one for resetting. Those buttons work fine with me, because I'm the one who developed this app, but what if I need to send it to some one else?
Javeed M ShaikhPosted Sep 6, 2013, 4:06 PM
these will be saved in the application settings file present on the users machine for that user.
Hind NajimPosted Sep 6, 2013, 2:59 PM
it is Windows form application and the values are user specific. Lets assume that I need to save the setting in my machine, how to use the appSettings of the application to achieve this? I found some articles and answers when I googled it, but still couldn't get the idea. ...
Javeed M ShaikhPosted Sep 6, 2013, 10:13 AM
I am assuming that it is a winform application installed on users machine.