Click here to Skip to main content
15,893,814 members
Home / Discussions / C#
   

C#

 
GeneralHow to save combobox values in forms Pin
Member 1265992631-Jul-16 20:46
Member 1265992631-Jul-16 20:46 
I have two forms form1 and form2.in form1 I have a button that opens form2.in form2 I have a combobox and button.on clicking a button in form1,form2 will be displayed,then in form 2 I will add items to comboxbox by clicking a button present in form2.on closing the form2,the values added by clicking the button disappears,so help me to come out of it.i don't want to use databases.i just want that values be binded until the close of main form Form1.
Form1.cs

private button1_click(object o,EventArgs e)
{
Form2 F2 = new Form2;
F2.Show();
}


Form2.cs
int i=0;
private void button1_Click(object sender, EventArgs e)
{
i = i + 1;

comboBox1.SelectedIndex = comboBox1.Items.Add("Message" + i);

}
help me with proper examples
The scope of saving,means values on combox box must be remained until the close of Form1.

modified 1-Aug-16 3:12am.

GeneralRe: How to save combobox values in forms Pin
Richard MacCutchan31-Jul-16 21:23
mveRichard MacCutchan31-Jul-16 21:23 
GeneralRe: How to save combobox values in forms Pin
OriginalGriff31-Jul-16 21:27
mveOriginalGriff31-Jul-16 21:27 
GeneralRe: How to save combobox values in forms Pin
Member 126599261-Aug-16 19:00
Member 126599261-Aug-16 19:00 
GeneralRe: How to save combobox values in forms Pin
Pete O'Hanlon1-Aug-16 20:18
mvePete O'Hanlon1-Aug-16 20:18 
GeneralRe: How to save combobox values in forms Pin
Member 126599261-Aug-16 20:31
Member 126599261-Aug-16 20:31 
GeneralRe: How to save combobox values in forms Pin
Pete O'Hanlon1-Aug-16 20:35
mvePete O'Hanlon1-Aug-16 20:35 
GeneralRe: How to save combobox values in forms Pin
Member 126599261-Aug-16 22:38
Member 126599261-Aug-16 22:38 
GeneralRe: How to save combobox values in forms Pin
Pete O'Hanlon1-Aug-16 23:36
mvePete O'Hanlon1-Aug-16 23:36 
GeneralRe: How to save combobox values in forms Pin
Member 126599261-Aug-16 23:39
Member 126599261-Aug-16 23:39 
GeneralRe: How to save combobox values in forms Pin
Pete O'Hanlon1-Aug-16 23:53
mvePete O'Hanlon1-Aug-16 23:53 
GeneralRe: How to save combobox values in forms Pin
Member 126599262-Aug-16 1:13
Member 126599262-Aug-16 1:13 
QuestionEF 6 and C# applications (Web & Windows) Pin
Zeyad Jalil31-Jul-16 20:20
professionalZeyad Jalil31-Jul-16 20:20 
AnswerRe: EF 6 and C# applications (Web & Windows) Pin
Nathan Minier1-Aug-16 3:50
professionalNathan Minier1-Aug-16 3:50 
AnswerRe: EF 6 and C# applications (Web & Windows) Pin
Gerry Schmitz1-Aug-16 5:21
mveGerry Schmitz1-Aug-16 5:21 
AnswerRe: EF 6 and C# applications (Web & Windows) Pin
Mycroft Holmes1-Aug-16 13:01
professionalMycroft Holmes1-Aug-16 13:01 
QuestionHow To Create Math Parser? Pin
Daniyaltjm31-Jul-16 2:12
Daniyaltjm31-Jul-16 2:12 
AnswerRe: How To Create Math Parser? Pin
OriginalGriff31-Jul-16 2:29
mveOriginalGriff31-Jul-16 2:29 
GeneralRe: How To Create Math Parser? Pin
Daniyaltjm31-Jul-16 4:07
Daniyaltjm31-Jul-16 4:07 
GeneralRe: How To Create Math Parser? Pin
OriginalGriff31-Jul-16 4:19
mveOriginalGriff31-Jul-16 4:19 
Questionneed help witch creating method Pin
Member 1138393529-Jul-16 23:55
Member 1138393529-Jul-16 23:55 
AnswerRe: need help witch creating method Pin
OriginalGriff30-Jul-16 0:11
mveOriginalGriff30-Jul-16 0:11 
QuestionParsing a string with multiple values - JSON or Retro? Pin
Michael Breeden29-Jul-16 1:48
Michael Breeden29-Jul-16 1:48 
AnswerRe: Parsing a string with multiple values - JSON or Retro? Pin
Richard Deeming29-Jul-16 2:09
mveRichard Deeming29-Jul-16 2:09 
GeneralRe: Parsing a string with multiple values - JSON or Retro? Pin
Michael Breeden29-Jul-16 2:43
Michael Breeden29-Jul-16 2:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.