读书人

哪位高手能帮小弟我把这段VB转成C#很简

发布时间: 2012-01-14 20:02:35 作者: rapoo

谁能帮我把这段VB转成C#啊?很简单的,谢谢了。。
谁能帮我把这段VB转成C#啊?很简单的,谢谢了。。

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Static bool As Boolean = True
If bool Then
Me.Size = New Size(300, 243)
Button1.Text = "设置<<"
Else
Me.Size = New Size(300, 170)
Button1.Text = "设置>>"
End If
bool = Not bool
End Sub

[解决办法]
private void Button1_Click(object sender,EventArgs e)
{
static Bool bool = true;
if(bool == true)
{
this.Size=new Size(330,243);
Button1.Text = "设置 < <";
}
else
{
this.Size = new Size(300, 170)
Button1.Text = "设置> > "
}
bool = !bool;
}

[解决办法]

{
static bool @bool = true;
if (@bool) {
this.Size = new Size(300, 243);
Button1.Text = "设置 < <";
}
else {
this.Size = new Size(300, 170);
Button1.Text = "设置> > ";
}
@bool = !@bool;
}

读书人网 >C#

热点推荐