VB mouseup mousedown问题
DimswAsBooleanPublicFunctionfun(XAsInteger)AsIntegerIfX<20ThenY=XElseY=20+XEndIffun=Y...
Dim sw As Boolean
Public Function fun(X As Integer) As Integer
If X < 20 Then
Y = X
Else
Y = 20 + X
End If
fun = Y
End Function
Private Sub Command1_Click()
Dim intnum As Integer
intnum = InputBox("")
If sw Then
Print fun(intnum)
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
sw = False
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
sw = True
End Sub
程序运行后,单机命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序执行结果是? 展开
Public Function fun(X As Integer) As Integer
If X < 20 Then
Y = X
Else
Y = 20 + X
End If
fun = Y
End Function
Private Sub Command1_Click()
Dim intnum As Integer
intnum = InputBox("")
If sw Then
Print fun(intnum)
End If
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
sw = False
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
sw = True
End Sub
程序运行后,单机命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序执行结果是? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询