本文介绍了如何在SaveFileDialog中使用复选框选项作为只读?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个 SaveFileDialog
框,其中包含 CheckBox
选项,只读或不是
我有一个事件按钮的代码
I would like to make a SaveFileDialog
box with a CheckBox
option for read only or not
I have this code for a event button
private void button1_Click(object sender, EventArgs e)
{
Stream myStream;
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
saveFileDialog1.FilterIndex = 2;
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
if ((myStream = saveFileDialog1.OpenFile()) != null)
{
// Code to write the stream goes here.
myStream.Close();
}
}
}
推荐答案
这篇关于如何在SaveFileDialog中使用复选框选项作为只读?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!