Matthew的Blog

  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
private   void  button2_Click( object  sender, System.EventArgs e)
        
{
            
string  FileName;
            
if  ( this .openFileDialog1.ShowDialog()  ==  DialogResult.OK)
            
{
              FileName 
=   this .openFileDialog1.FileName;
              
if  (FileName  !=   "" )
              
{
                
this .pictureBox1.Image  =  Image.FromFile(FileName);
              }

            }

        }
posted on 2006-04-29 13:25 matthew 阅读(11778) 评论(1)  编辑 收藏 引用 所属分类: C#编程

评论

# re: C#中openFileDialog的使用[未登录] 2008-08-03 16:23 初学者
你说的怎么有错啊,我试了一下,当第一次打开openFileDialog时,在没关的基础上打开就报错  回复  更多评论
  

只有注册用户登录后才能发表评论。