Click here to Skip to main content
15,891,529 members
Home / Discussions / C#
   

C#

 
GeneralRe: check the password wi-fi in c# Pin
Pete O'Hanlon2-Aug-16 1:44
mvePete O'Hanlon2-Aug-16 1:44 
Generalhow to group the controls in to single component. Pin
Member 126599261-Aug-16 18:42
Member 126599261-Aug-16 18:42 
GeneralRe: how to group the controls in to single component. Pin
OriginalGriff1-Aug-16 20:23
mveOriginalGriff1-Aug-16 20:23 
GeneralRe: how to group the controls in to single component. Pin
BillWoodruff2-Aug-16 2:18
professionalBillWoodruff2-Aug-16 2:18 
GeneralRe: how to group the controls in to single component. Pin
Member 126599262-Aug-16 2:22
Member 126599262-Aug-16 2:22 
QuestionOffice 2016-Like Help for .NET application Pin
Jassim Rahma1-Aug-16 11:18
Jassim Rahma1-Aug-16 11:18 
QuestionHow to Insert/update/delete records in multiple Databases tables in one transaction using C# Pin
Tej_dev1-Aug-16 8:44
Tej_dev1-Aug-16 8:44 
AnswerRe: How to Insert/update/delete records in multiple Databases tables in one transaction using C# Pin
Eddy Vluggen1-Aug-16 10:17
professionalEddy Vluggen1-Aug-16 10:17 
AnswerRe: How to Insert/update/delete records in multiple Databases tables in one transaction using C# Pin
Mycroft Holmes1-Aug-16 12:50
professionalMycroft Holmes1-Aug-16 12:50 
QuestionRequest for advice: 3D realistic scene interface Pin
Jayme651-Aug-16 6:22
Jayme651-Aug-16 6:22 
JokeRe: Request for advice: 3D realistic scene interface Pin
Richard Deeming1-Aug-16 6:44
mveRichard Deeming1-Aug-16 6:44 
AnswerRe: Request for advice: 3D realistic scene interface Pin
Richard MacCutchan1-Aug-16 22:07
mveRichard MacCutchan1-Aug-16 22:07 
GeneralHow to save combobox values in forms Pin
Member 1265992631-Jul-16 20:46
Member 1265992631-Jul-16 20:46 
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 
here is the code that I have tried
Form1 has a single button.
Form1.cs
private int index = 0;
private void button1_Click(object sender, EventArgs e)
{

Form2 F2 = new Form2();
F2.SelectedIndex = index;
F2.ShowDialog();
index = F2.SelectedIndex;
}

Form2 has a combobox and a button
Form2.cs

int i = 0;
private void button1_Click(object sender, EventArgs e)
{
i = i + 1;
comboBox1.Items.Add("Message" + i);
}

public int SelectedIndex
{
get { return comboBox1.SelectedIndex; }
set { comboBox1.SelectedIndex = value; }
}

aboveis the code.on running the above.i clicked the button on form1 it opens form2.in form2 on cliking the button I have added items to form1.then I close the form2 and reopen it from form1 button.then also no item will be present in combobox on form2.
please let me know where I did wrong.
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 

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.