OpenFileDialog

[ 2006-05-09 12:30:37 | 作者: admin ]
字号: | |
private void button1_Click(object sender, System.EventArgs e)
{
      // Displays an OpenFileDialog so the user can select a Cursor.
      OpenFileDialog openFileDialog1 = new OpenFileDialog();

      openFileDialog1.Filter = "Cursor Files|*.cur";
      //openFileDialog1.Filter = "txt files (*.txt)|*.txt";

      openFileDialog1.Title = "Select a Cursor File";

      // Show the Dialog.
      // If the user clicked OK in the dialog and
      // a .CUR file was selected, open it.
        if (openFileDialog1.ShowDialog() == DialogResult.OK)
      {
            // Assign the cursor in the Stream to the Form's Cursor property.
            this.Cursor = new Cursor(openFileDialog1.OpenFile());
      }
}
评论Feed 评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=535

这篇日志没有评论。

此日志不可发表评论。