[Solved] Accessing Forms data from another form

First of all you have to create an instance of Form2. namespace WindowsFormsApplication1 { public partial class Form1 : Form { private Form2 form2; public Form1() { InitializeComponent(); form2 = new Form2(); } private void button1_Click(object sender, EventArgs e) { String value1 = File.ReadAllText(textBox1.Text); foreach (string line in value1.Split(‘\n’)) { form2.listBox1.Items.Add(line); } } } } … Read more

[Solved] binding an List of objects to a Listbox

The Error you are getting is probably: Items collection must be empty before using ItemsSource. There is probably no problem with binding…. your bigest problem is invalid xaml. I am not sure what you are trying to achieve, but I guess you want to have listbox with horizonatal Stackpanel as ItemsPanel. Then it should be … Read more

[Solved] About ListBox limit item [closed]

From your question, it looks like you need to implement virtualization on the listbox. You can either use a VirtualizingStackPanel inside a Listbox as ItemsPanel Template or you use – ItemsControl and set its property VirtualizingStackPanel.IsVirtualizing=”True” This should help. solved About ListBox limit item [closed]