Tuesday, 12 June 2012

what is the difference between show and show dialog in c#.Net


These methods are used in Window applications to call one form from another
ShowDialog()
ShowDialog shows activated window and parent form cannot be Accessed by the user.
private void button_Click(object s, EventArgs e)
{
Form1 f=new Form1();
f.ShowDialog();

}

Show()
Show shows the window but other application windows are accessible.
private void button1_Click(object s, EventArgs e)
{
Form2 f=new Form2();
f.ShowDialog();

}

No comments:

Post a Comment