Example #1
0
        /// <summary>
        /// 选择文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btSelectFile_Click(object sender, EventArgs e)
        {
            if (null == _method)
            {
                ShowTips("无效操作,方法对象未设置");
                return;
            }
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter           = "图片文件(*.*)|*.*";
            ofd.InitialDirectory = Application.StartupPath;
            ofd.ValidateNames    = true;
            ofd.CheckPathExists  = true;
            ofd.CheckFileExists  = true;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                _method.SetInitParamValue("FilePath", ofd.FileName);
                tbFilePath.BackColor = SystemColors.Control;
                tbFilePath.Text      = ofd.FileName;
                //_isFilePathEditting = false;
            }
        }