Professional Documents
Culture Documents
OpenFileDialog Control
This control is used to display
open file dialog box to the user
so that user can select any file
to Open.
This control is available in using
System.Windows.Forms.OpenFil
edialogBox
PROPERTI DESCRIPTION
ES
1.
DefaultEx
t
2.
FileName
3.
Filter
4.
Dialog
Result
SaveFileDialog Control
This control is used to display Save
file dialog box to the user so that
user can save any filename.
This control is available in using
System.Windows.Forms.SaveFileDialo
gBox
PROPERTI DESCRIPTION
ES
1.
FileName
2.
Filter
#region mnunew_Click
private void mnunew_Click(object sender,
EventArgs e)
{
textBox1.Text = "";
}
#endregion
mnupagesetup_Click
#region mnupagesetup_Click
private void
mnupagesetup_Click(object sender,
EventArgs e)
{
PageSettings pg =new
PageSettings();
pageSetupDialog1.PageSettings=
pg;
pageSetupDialog1.ShowDialog();
}
mnuprintdialog_Click
#region mnuprintdialog_Click
private void
mnuprintdialog_Click(object sender,
EventArgs e)
{
printDialog1.ShowDialog();
}
#endregion
Code for
mnuselectall_Click
#region mnuselectall_Click
private void
mnuselectall_Click(object sender,
EventArgs e)
{
textBox1.SelectAll();
}
mnuaboutus_Click
Take a new form about.cs
#region mnuaboutus_Click
private void
mnuaboutus_Click(object sender,
EventArgs e)
{
About abt = new About();
abt.Show();
this.Hide();
}
#endregion
mnuclose_Click
#region mnuclose_Click
private void
mnuclose_Click(object sender,
EventArgs e)
{
this.Close();
}
#endregion
mnucolordialog_Click
#region mnucolordialog_Click
private void mnucolordialog_Click(object
sender, EventArgs e)
{
colorDialog1.ShowDialog();
//textBox1.ForeColor =
colorDialog1.Color;
}
Form1_Closing
private void Form1_Closing(object sender,
System.ComponentModel.CancelEventAr
gs e)
{
if (textBox1.Text != strMyOriginalText)
{
if(MessageBox.Show("Do you want to
save changes to your text?", "My
Application", MessageBoxButtons.YesNo)
== DialogResult.Yes)
{e.Cancel = true; } } }
MDI APPLICATION
The applications that we allow the
user to work with more than one files
or documents at once are known as
MDI applications
Ex :MsEcel,Msword,MsPowerPoint
etc