VB问题,十万火急~菜鸟求帮助,高手速来助!谢谢~拒绝沙发!

我做了一个自动关机的代码,但怕它不设置时间导致直接关机,所以把:PrivateSubenter_Click()DimhAsInteger,mAsInteger,sAsIn... 我做了一个自动关机的代码,但怕它不设置时间导致直接关机,所以把:
Private Sub enter_Click()
Dim h As Integer, m As Integer, s As Integer
h = t1.Text
m = t2.Text
s = t3.Text
Shell "shutdown -s -f -t " & h * 3600 + m * 60 + s
End Sub
这段代码加成了:
Private Sub enter_Click()
Dim h As Integer, m As Integer, s As Integer
h = t1.Text
m = t2.Text
s = t3.Text
if h+m+s>1 then
Shell "shutdown -s -f -t " & h * 3600 + m * 60 + s
else
beep
magbox "请输入数据!“
--------------------------------
却显示我没定义~怎么办
展开
 我来答
ARTERIOSCLEROS
2008-11-15 · TA获得超过4188个赞
知道大有可为答主
回答量:1672
采纳率:0%
帮助的人:2638万
展开全部
这样改。
=============
Private Sub enter_Click()
Dim h As Integer, m As Integer, s As Integer
h = t1.Text
m = t2.Text
s = t3.Text
if h+m+s>1 then
Shell "shutdown -s -f -t " & h * 3600 + m * 60 + s
else
beep
msgbox "请输入数据!" '看看你的拼写错误,另外引号之能是"而不能是“
end if '必须有这一句.
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式