开发者

MDI Parent and Children

I have four children in a parent container. Each child form is a test for the user to type correct answers into text boxes. Option to open each form is on a menu strip in the parent. In form load, I have disabled all but the first form option. I only want the second form to become available if the first form answers are correct. I would like to figure this out on my own as much as possible. I have searched on line but since I am not sure what to ask, I have not found and answer. Can someone get me started in the right direction? Perhaps some reading that would explain how to go about this, or what I should be typing into google to get what I'm looking for.

Thanks.

private bool CheckFormExistence(stringformName)
{ 
    bool formFound = false; 
    foreach (Form formTest in MdiChildren)
        if (formTest.Name== formName) 
        { 
            Activate(); 
            formFound = true;
        }
    return formFound; 
} 

private void toolStripMenuItemStationOne_Click(object sender, EventArgs e)
{ 
    bool formExists = false; 
    FormBlue1 blueOne; 
    formExists = CheckFormExistence("FormBlue1");
    if (!f开发者_开发百科ormExists) 
    { 
        blueOne = new FormBlue1(); 
        blueOne.MdiParent = this;
        blueOne.Show(); 
    } 
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜