What is the difference between "Show() "and "ShowDialog()"?
-
private delegate void TestHandler();
private TestHandler mTestDelegate;public fmMain()
{
InitializeComponent();
}private void fmMain_Load(object sender, EventArgs e)
{
mTestDelegate = new TestHandler(() =>
{
Form fmTest = new Form();
fmTest.ShowDialog();//don't write "Show()"
});
mTestDelegate.BeginInvoke(null, null);
}Why can not I Wrtie "fmTest.Show()"
-
private delegate void TestHandler();
private TestHandler mTestDelegate;public fmMain()
{
InitializeComponent();
}private void fmMain_Load(object sender, EventArgs e)
{
mTestDelegate = new TestHandler(() =>
{
Form fmTest = new Form();
fmTest.ShowDialog();//don't write "Show()"
});
mTestDelegate.BeginInvoke(null, null);
}Why can not I Wrtie "fmTest.Show()"
Please do not post the same thing in multiple places - it wastes time and can annoy people.
The only instant messaging I do involves my middle finger.
-
Please do not post the same thing in multiple places - it wastes time and can annoy people.
The only instant messaging I do involves my middle finger.
i am very sorry to do that.
-
private delegate void TestHandler();
private TestHandler mTestDelegate;public fmMain()
{
InitializeComponent();
}private void fmMain_Load(object sender, EventArgs e)
{
mTestDelegate = new TestHandler(() =>
{
Form fmTest = new Form();
fmTest.ShowDialog();//don't write "Show()"
});
mTestDelegate.BeginInvoke(null, null);
}Why can not I Wrtie "fmTest.Show()"
.Show will show the form you want to display and will allow you to go back to the other window without closing it, and .ShowDialog will show the form you want to display and wont allow you to go back to the other window with out closing the new window.
-
private delegate void TestHandler();
private TestHandler mTestDelegate;public fmMain()
{
InitializeComponent();
}private void fmMain_Load(object sender, EventArgs e)
{
mTestDelegate = new TestHandler(() =>
{
Form fmTest = new Form();
fmTest.ShowDialog();//don't write "Show()"
});
mTestDelegate.BeginInvoke(null, null);
}Why can not I Wrtie "fmTest.Show()"
I think you wont be able to do: fmTest.Show(); as "fmTest" is the main/only form. Can someone correct me if im wrong.
-
I think you wont be able to do: fmTest.Show(); as "fmTest" is the main/only form. Can someone correct me if im wrong.
i want to know why I wrote "fmTest.Show()", the form("fmTest") will not be responded?? i hopt you copy my code and run it ,you will understand it Thank you!