[C#] openFileDialog 简单应用
2010-09-19 17:35
363 查看
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShowPicture
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void 打开图片ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.openFileDialog.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(openFileDialog.FileName);
}
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ShowPicture
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void 打开图片ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.openFileDialog.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(openFileDialog.FileName);
}
}
}
}
相关文章推荐
- C#的OpenFileDialog的简单用法
- openFileDialog/saveFileDialog/folderBrowserDialog三个控件的应用(winform程序简单)
- OpenfileDialog选择照片的简单应用
- OpenFileDialog 在Win32、MFC、C#的实现
- c#中OpenFileDialog的使用
- 4.20学习笔记c# OpenFileDialog
- C#开发:openfiledialog的使用
- c#设置OpenFileDialog的Filter属性
- C#中的OpenFileDialog
- C#中关于openFileDialog()
- C#中OpenFileDialog和PictrueBox的用法分析
- c# Web Application 中使用FileUpload代替OpenFileDialog
- [转载]c# OpenFileDialog
- c# OpenFileDialog
- C# Winform OpenFileDialog 控件
- C#中OpenFileDialog获取文件名和文件路径的常用方法.
- c# Web Application 中使用FileUpload代替OpenFileDialog
- C# openfiledialog的使用
- 【C#】WinForm小技巧几则(openFileDialog+datagrapview)
- C#中 openfiledialog 和 FolderBrowserDialog 的使用 2