开发者

how to pass button_click to child window in C#?

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();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜