using DevExpress.XtraEditors; namespace PBS.WinFrmUI.Hydro { public partial class SelectBackgroundImageForm : XtraForm { public SelectBackgroundImageForm() { InitializeComponent(); } public string PicPath { get; set; } private void simpleButton2_Click_1(object sender, EventArgs e) { this.Close(); } private void pictureEdit1_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Image Files (*.bmp;*.jpg;*.jpeg;*.png;*.gif)|*.bmp;*.jpg;*.jpeg;*.png;*.gif"; openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); if (openFileDialog.ShowDialog() == DialogResult.OK) { PicPath = openFileDialog.FileName; pictureEdit1.Image = Image.FromFile(PicPath); } } } }