One source of data and 2 display forms
I have one data source that is processed by Form1 app. I wish to split the input data and display some data on Form1 using a listbox control (already done) and display the remaining data on Form2 also using a listbox control and update both forms at the same time. Is their a way to globalize the Form2 listbox control to access it from Form1 app. Thanks for your help.
Jaish MathewsPosted Apr 27, 2010, 1:35 PM
The same stratogy need to apply. What ever values you need to pass across pages, declare a property which can return those values acoss any page. I am not seeing any problem here. May be not understanding your real problem.
Michael ThompsonPosted Apr 27, 2010, 12:59 PM
Thank you for your reply. In Form1 I receive a data steam that is currently displayed in the form1 listbox. I want to create a new Form2 with a new listbox and display some of that Form1 data on the Form2 listbox. I have looked for a simple solution and have not found one yet. Thanks.
MikeT
Jaish MathewsPosted Apr 27, 2010, 12:39 PM
If you are asking to take Fom2 ListBox in Form1, it's possible. Do below steps
Define a property in Form2 as an entry point to access it's ListBox to outside classes
public ListBox Form2ListBox
{
get
{
return this.listBox1;
}
}
Call this proerty in Form1 like below
Form2 frm = new Form2();
ListBox lb = frm.Form2ListBox;