日期:2014-05-18  浏览次数:20722 次

谁能帮我把这段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; 
}