北京理工大学金旭亮老师C#(35—ShowPicInForm)

  /// <summary>
        /// Load pic from file.
        /// </summary>
        private void LoadPicture()
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                // MessageBox.Show(openFileDialog1.FileName);
                pictureBox1.ImageLocation = openFileDialog1.FileName;
            }
            else
            {
                MessageBox.Show("User Canceled.");
            }
        }

猜你喜欢

转载自blog.csdn.net/weixin_42681308/article/details/88806503