Can anyone here do me a favor?
I have a MainWindow with a HideButton and RetrieveButton. When I click on either one button, it will 开发者_如何学Pythongoes to another ChildWindow. My ChildWindow have a OKButton.
The question here, How to set if else statement in C# for pseudocode below?
private void OKButton_Click(object sender, EventArgs e)
{
// pseudocode
if (HideButton in MainWindow is clicked)
{
// Perform the works
}
if(RetrieveButton in MainWindow is clicked)
{
// Perform other works
}
Thanks in advance.
By, Aeris
If you are creating the child window on Retrieve or Hide you can easily pass parameters then either via the constructor or by setting a custom property:
ChildWindow child = new ChildWindow();
child.Retrieving = true;
child.Show();
精彩评论