private void textureBox_Click(object sender, EventArgs e) { using (TexturePicker texPicker = new TexturePicker(textures, materials[comboMaterial.SelectedIndex].TextureID)) { if (texPicker.ShowDialog(this) == DialogResult.OK) { materials[comboMaterial.SelectedIndex].TextureID = texPicker.SelectedValue; textureBox.Image = textures[materials[comboMaterial.SelectedIndex].TextureID].Image; RaiseFormUpdated(); } } }
private void textureBox_Click(object sender, EventArgs e) { if (textures == null) { MessageBox.Show("No textures loaded!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (TexturePicker texPicker = new TexturePicker(textures, materials[comboMaterial.SelectedIndex].TextureID)) { if (texPicker.ShowDialog(this) == DialogResult.OK) { materials[comboMaterial.SelectedIndex].TextureID = texPicker.SelectedValue; textureBox.Image = textures[materials[comboMaterial.SelectedIndex].TextureID].Image; RaiseFormUpdated(); } } }