• 2021-04-14
    在窗体上添加1个按钮Button1,然后编写Click事件代码:
    Dim x As Short = -1
    Dim y As Single
    If x <= 0 Then
    y = x ^ 2
    Else
    y = x
    End If
    Label1.Text = y.ToString
    程序运行后,单击按钮,窗体上显示的是