void OnButtonClick() { ImagePickerDialog.Launch((string)editor.data ?? "", null, (success, imageId) => { if (success) { editor.SetData(imageId); onValueChanged?.Invoke(imageId); } }); }
private void ImagePickerButton_Click(object sender, System.EventArgs e) { var result = ImagePickerDialog.ShowDialog(); if (result == DialogResult.OK) { try { BackgroundPreviewPanel.BackgroundImage = Bitmap.FromFile(ImagePickerDialog.FileName); } catch (Exception) { MessageBox.Show("Could not open image file.", "Error", MessageBoxButtons.OK); } } }