private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { if (propertyGrid1.SelectedObject != null) { Texture tex = (Texture)propertyGrid1.SelectedObject; textureData.Text = tex.Name; pictureBoxCustom1.Image = textureData.UpdateBitmap(new Bitmap(pictureBoxCustom1.Image)); } }