
您好,Private Sub Form_Click()
If x = 0 Then '判断X是不是0,如果是执行下面代码
x = x + 1
MeCaption = "欢迎你的到来"
MeWidth = 4700
MeHeight = 3500
Label1Caption = "VB程序设计"
Else '如果不是0,执行下面代码
x = 0
Call Form_Load
End If
End Sub
Private Sub Command1_Click()
If 0 Then Print "hello"
End Sub
‘if true then 这是原型函数,这里的0就是false,也就是条件为假,也就是不输出 "hello"这个字符,你可以把它改为1测试一下,1条件为真,直接打印出"hello"字符。
Private Sub cmdTestClick ( ) '打开串口
MSCommlCommPort =2 '设定Com2
If MSCommlPortOpen = False Then
MSComm1Settings = "9600,n,8,1" '9600波特率,无校验,8位数据位,1位停止位
MSComm1PortOpen = True '打开串口
End if
MSComm1OutBufferCount = 0 '清空发送缓冲区
MSComm1InBufferCount = 0 '滑空接收缓冲区
'发送字符数据时必须用回车符(vbcr)结束
MSComm1Output="This is a qood book ! " &vbCr
End Sub
private Sub MScommEvent( )
Select Case MSComm1CommEvent
Case comEvReceive
Dim Buffer As Variant
MSComm1InputLen = 0
'接收字符数据
MSComm1InputMode=comInputModeText
Buffer = MSCommlInput
Case else
End Select
End sub
以上就是关于设计一个窗体,窗体的标题为"VB程序设计",运行程序时,单击窗体窗体标题改变,并输出"hello"全部的内容,包括:设计一个窗体,窗体的标题为"VB程序设计",运行程序时,单击窗体窗体标题改变,并输出"hello"、vb中 if 0 then print “hello” 什么意思、利用vb的mscomm发送 “你好,123,hello,@#¥”,程序如何编写,请举例说明。要求完整等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)