★★VB中相当于C的{}是?

xxiao07 2004-07-18 03:51:41
begin.....
end
对吗?
为什么出错?
...全文
52 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
duguguiyu1984 2004-07-18
  • 打赏
  • 举报
回复
写就行了阿
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim x As Double
If e.KeyChar() = Microsoft.VisualBasic.ChrW(13) Then
If IsNumeric(TextBox1.Text) = True Then
x = TextBox1.Text
If x = 0 Then
TextBox2.Text = 100
ElseIf x > 0 Then
TextBox2.Text = x * x + 5
ElseIf x < 0 Then
TextBox2.Text = (x + 1) / (Math.Abs(x + 50) + 2)

End If
TextBox1.SelectAll()
Else
TextBox1.Text=""
MsgBox("请输入数字!")
End If
End If

End Sub
xxiao07 2004-07-18
  • 打赏
  • 举报
回复
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim x As Double
If e.KeyChar() = Microsoft.VisualBasic.ChrW(13) Then
If IsNumeric(TextBox1.Text) = True Then
x = TextBox1.Text
If x = 0 Then
TextBox2.Text = 100
ElseIf x > 0 Then
TextBox2.Text = x * x + 5
ElseIf x < 0 Then
TextBox2.Text = (x + 1) / (Math.Abs(x + 50) + 2)

End If

Else

: MsgBox("请输入数字!")
★★-这里我还要加 TextBox1.Text="", 怎么写???
End If
End If
TextBox1.SelectAll()
End Sub
End Class
孟子E章 2004-07-18
  • 打赏
  • 举报
回复
Sub

End Sub

Function

End Function

If xx Then
End If

16,555

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧