开发者

if and else for visible form [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help cent开发者_如何学Cer. Closed 10 years ago.

i have this code but return error

private void formshow_Click(object sender, EventArgs e)
        {
           if (form1.Visible)                
               {
                   MessageBox.Show("This form is visible");
               }
           else
               {
                   Form2 f = new Form2();
                   f.Show();
               } 
        }

help me please


Is form1 the type of the current instance? If so, change if (form1.Visible) to if (this.Visible) or simply if (Visible).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜