vb有趣小程序

vb有趣小程序,第1张

整人的小程序,会d出对话框提示:快说我是猪,不输入的话会在1分钟之内自动关机,输入的话,当让会被笑话啦,呵呵

将以下文字粘贴到记事本上后将后缀名改为:vbe,然后双击即可!(里面的那些词语可以自行修改),经测试肯定可以使用。

on error resume next

dim WSHshellA

set WSHshellA = wscript.createobject("wscript.shell")

WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""说[我是猪],不说[我是猪],不信,试试···"" ",0 ,true

dim a

do while(a <>"我是猪")

a = inputbox ("说[我是猪],就不关机,快撒,说 ""[我是猪]"" ","说不说","不说",8000,7000)

msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"

loop

msgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"

dim WSHshell

set WSHshell = wscript.createobject("wscript.shell")

WSHshell.run "cmd.exe /c shutdown -a",0 ,true

msgbox chr(13) + chr(13) + chr(13) + "承认就好了嘛"

阻止关机的方法:按键盘上的Win键+R键,在出来的窗口中输入:shutdown -a 再按回车即可取消关机命令。

Dim a, b

Private Sub Command1_Click()

End

End Sub

Private Sub Form_Load()

Text.Text = "Visual Basic程序设计"

Command1.Caption = "结束"

Text.Left = 0: Text.Top = 0: Text.Width = 0.5 * Form1.Width

Text.Height = 0.5 * Form1.Height

a = Form1.Width - Command1.Left

b = Form1.Height - Command1.Top

End Sub

Private Sub Form_Resize()

Text.Left = 0: Text.Top = 0: Text.Width = 0.5 * Form1.Width

Text.Height = 0.5 * Form1.Height

Command1.Left = Form1.Width - a

Command1.Top = Form1.Height - b

End Sub

注意,各变量名,控件名保持一致,你题目中的文本框名称为text


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/7872410.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-10
下一篇2023-04-10

发表评论

登录后才能评论

评论列表(0条)

    保存