vb和vc++的区别

来源:百度知道 编辑:UC知道 时间:2024/05/12 20:22:10
我有个程序说是用vc++做的 为什么用vb也能用呢??

Private Sub Cmd_Cancel_Click()
Unload Me
End Sub

Private Sub Cmd_OK_Click()
'检查用户录入数据的有效性
If Len(Trim(txtBookNo)) = 0 Then
MsgBox "请输入图书编号!"
txtBookNo.SetFocus
txtBookNo.SelStart = 0
txtBookNo.SelLength = Len(txtBookNo)
Exit Sub
End If
If Len(Trim(txtBookName)) = 0 Then
MsgBox "请输入图书名称"
txtBookName.SetFocus
txtBookName.SelStart = 0
txtBookName.SelLength = Len(txtBookName)
Exit Sub
End If

If Len(Trim(txtPublisher)) = 0 Then
MsgBox "请输入出版社"
txtPublisher.SetFocus
txtPublisher.SelStart = 0
txtPublisher.SelLength = Len(txtPublisher)
Exit Sub
End If
If Len(Trim(txtPrice)) = 0 Then
MsgBox "请输入图书价格"
txtPrice.SetFocus
txtPrice.SelStart = 0
txtPrice.SelLengt

VB做的,VC++不能运行这个程序!
VB与VC 区别很大!除了编程思想一致之外,语言形式的东西几乎没有一样的

例如:VB的变量不区分大小写,VC中就要区分咯
例如:VB的条件判断 为 :
If ...Then
.....
End If
VC的是:
if (....)
{

}
else
{
}

明显是VB了 一看语法就知道了

vb