Quantcast
Channel: プログラム の個人的なメモ
Viewing all articles
Browse latest Browse all 860

【C#】【Form】OpenFileDialog

$
0
0

■ OpenFileDialog

 * ファイルを指定するダイアログ

■ 主なプロパティ

Multiselect

 * ファイルの複数の選択の可否

Filter

ファイルの種類の選択

Xmlファイル(*.xml)|*.xml|テキストファイル(*.txt)|*.txt|すべてのファイル(*.*)|*.*

Title

 * 題名

■ サンプル

private void button1_Click(略)
{
    if (this.openFileDialog1.ShowDialog() == DialogResult.OK &&
        System.IO.File.Exists(openFileDialog1.FileName))
    {
        MessageBox.Show("ファイルあります");
    }         
}

Viewing all articles
Browse latest Browse all 860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>