<1>C#MessageBox用法:
DialogResult dr = MessageBox.Show("是否删除?", "提示", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
if (dr == DialogResult.No) //选择NO选项
{
}
else if (dr == DialogResult.Yes) //选择YES选项
{
}
<2>C#FolderBrowserDialog用法
在窗体中添加FolderBrowserDialog控件,然后添加一个Button,在Button事件中添加如下代码:
DialogResult result = folderBrowserDialog1.ShowDialog();
if (result == DialogResult.OK)
{
DBPath.Text = folderBrowserDialog1.SelectedPath + "\\"; //获取选择路径
}
时间: 2024-09-30 00:08:04