ColorDialog
)
if (colorDialog1.ShowDialog() == DialogResult.OK) label1.ForeColor = colorDialog1.Color;
FontDialog
)
if (fontDialog1.ShowDialog() == DialogResult.OK) this.Font = fontDialog1.Font;
FolderBrowserDialog
)
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) MessageBox.Show("Selected " + folderBrowserDialog1.SelectedPath);
OpenFileDialog
)
openFileDialog1.Filter = "Text files (*.txt)|*.txt|All files|*.*"; if (openFileDialog1.ShowDialog() == DialogResult.OK) MessageBox.Show("Selected " + openFileDialog1.FileName);
filter
property to specify file types
SaveFileDialog
)
saveFileDialog1.Filter = "Text files (*.txt)|*.txt|All files|*.*"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) MessageBox.Show("Selected " + saveFileDialog1.FileName);
filter
property to specify file types
PrintDialog
)
PrintDocument
PrintDocument doc = new PrintDocument(); doc.DocumentName = "My document"; doc.PrintPage += new PrintPageEventHandler(doc_PrintPage); printDialog1.Document = doc; printDialog1.ShowDialog();
PrintPage
is an event which is triggered when the page is printing