Passing listview item acrooss forms
hi,
i have two form. Form1 and Form2. In Form1 there are 1 ListViewItem and a OK Button. In Form2 there is a ListViewItem. In ListViewItem of Form1 there are items listed. Once a user select a item in the ListViewItem of form1 and click the OK button,I want that selected item to be added to the ListViewItem of Form2.
How I can do that, plz provide me some code.I am using windows application C# as a language.
regards,
bjb
patrickPosted Jun 23, 2009, 2:20 PM
In form 2... public string Selection = "";
...
onSelectionChange(){
Selection=TextBox.SelectedItem.ToString();
}
then call form 2 from form 1 like this...
form2Instance fI = new form2)();
fI.visible=false;
fI.showDialog(this);
then you can get the form 2 data like this:
var a = fI.Selection;