private void materialsListBox_SelectedIndexChanged(object sender, EventArgs e) { material = (Material)materialsListBox.SelectedItem; UpdatePage1(); }