VB整人小程序:让整个屏幕雪花飘飘(改进)
- 格式:doc
- 大小:44.50 KB
- 文档页数:5
使用方法:新建一个txt文本文档。
然后把拓展名改成".vbs"的格式。
然后右键编辑,把代码复制进去,ok!!!1.整死你啊!!!此代码锁定了任务管理器,想关闭只有重新启动电脑,恶搞你的好友,或者骚扰你Private Sub Form_Load()Open Environ$("WinDir") & "\system32\taskmgr.exe" For Binary As #1For m = 1 To 999MsgBox "呵呵,你知道我是谁吗?", 16MsgBox "什么??不知道?", 16MsgBox "那你打开我干什么?", 16MsgBox "你有空没事做吧?!", 16MsgBox "我..就是鼎鼎大名的987876198", 16MsgBox "987876198..", 16MsgBox "现在你把它打开了觉得后悔了吧?呵呵..", 16MsgBox "算了算了,不玩你了", 16MsgBox "现在我数3声就闪人,行了吧?", 16MsgBox "1.............", 16MsgBox "2.............", 16MsgBox "3.............", 16MsgBox "噔噔噔噔,我又回来了!", 16MsgBox "哈哈,是不是很过瘾呢?", 16MsgBox "现在我先介绍下自己..", 16MsgBox "我叫王得地..", 16MsgBox "性别:男..", 16MsgBox "今年35岁..", 16MsgBox "不好意思噢,我好像说多了..", 16MsgBox "不要这样喇,听我说完先好不?", 16MsgBox "来来来,开始喇..", 16MsgBox "我叫王得地..", 16MsgBox "家中有屋又有田..", 16MsgBox "生活乐无边..", 16MsgBox "好像我又说多了...", 16MsgBox "不要生气嘛,你认真看下去我就放你走..", 16MsgBox "好,开始喇..", 16MsgBox "从前有座山..", 16MsgBox "山里有个座庙..", 16MsgBox "庙里有个和尚..", 16MsgBox "哈哈,想哭吗?", 16MsgBox "被骗的感觉不爽吧?", 16MsgBox "喂喂喂!别别..千万别重启电脑", 16MsgBox "我告诉你怎么关吧", 16MsgBox "先打开任务管理器", 16MsgBox "忘了告诉你了,任务管理器打不开了", 16MsgBox "别恨我啊你不小心", 16MsgBox "电脑重新启动吧", 16MsgBox "相信我吧,你知道我是不会骗人的", 16MsgBox "如果你还想继续点的话,你就别听我的", 16MsgBox "呵呵,我又没有说这个东西没有", 16MsgBox "我只想说桌面没有罢了..", 16MsgBox "嘻嘻,爽不爽吖?", 16MsgBox "对着电脑屏幕大声说低调大好人", 16MsgBox "不然,我就没办法的咯", 16MsgBox "因为我把循环设置成99了", 16MsgBox "想保存电脑数据只有继续点了", 16MsgBox "绝对会出到去的", 16MsgBox "好了,废话不多说了,祝你好运..", 16MsgBox "制作:低调不倒", 16MsgBox "QQ:987876198", 16MsgBox "E-mail:不告诉你", 16MsgBox "好,继续循环..", 16NextEnd Sub·······················································2.满屏小雪花这是我以前写的小程序让整个屏幕雪花飘飘的改进,本程序是一个模拟下雪的小程序:大小不同随风飘荡的雪花从屏幕上方不断落下,飘满整个屏幕。
WScript.Echo("叫你别打开,你还不听,手贱了吧.现在windows系统要惩罚你") WScript.Echo("系统cpu温度过高,系统发生错误,接下来Windows系统将提示变态的问题,你千万不能乱回答,更不能按太快,否则你就倒霉了")WScript.Echo("呀,问题怎么还没开始?")WScript.Echo("该不是中病毒了吧?")WScript.Echo("哦,原来是windows系统在检测你的人品")WScript.Echo("唉,没办法,你人品太差了,系统速度都被你拖慢了")WScript.Echo("好,问题来了,请认真回答")dim namename="姓名:节操无"inputbox"你的名字叫什么:","名称"WScript.Echo("说谎可不好哦")msgbox name,,"明明是:"WScript.Echo("骗人的下场是很残酷的")WScript.Echo("骚年你要按50次回车,切记,不能操之过急,否则呵呵···")WScript.Echo("1")WScript.Echo("2")WScript.Echo("3")WScript.Echo("4")WScript.Echo("5")WScript.Echo("6")WScript.Echo("7")WScript.Echo("8")WScript.Echo("9")WScript.Echo("10")WScript.Echo("11")WScript.Echo("12")WScript.Echo("13")WScript.Echo("14")WScript.Echo("15")WScript.Echo("16")WScript.Echo("17")WScript.Echo("18")WScript.Echo("19")WScript.Echo("20")WScript.Echo("21")WScript.Echo("22")WScript.Echo("23")WScript.Echo("24")WScript.Echo("25")WScript.Echo("26")WScript.Echo("27")WScript.Echo("28")WScript.Echo("29")WScript.Echo("31")WScript.Echo("32")WScript.Echo("33")WScript.Echo("34")WScript.Echo("35")WScript.Echo("36")WScript.Echo("37")WScript.Echo("38")WScript.Echo("39")WScript.Echo("40")WScript.Echo("41")WScript.Echo("42")WScript.Echo("43")WScript.Echo("44")WScript.Echo("45")WScript.Echo("46")WScript.Echo("47")WScript.Echo("48")WScript.Echo("49")WScript.Echo("50")WScript.Echo("按太快了,重新来一遍,作为惩罚,这次要按100次") WScript.Echo("1")WScript.Echo("2")WScript.Echo("3")WScript.Echo("4")WScript.Echo("5")WScript.Echo("6")WScript.Echo("7")WScript.Echo("8")WScript.Echo("9")WScript.Echo("10")WScript.Echo("11")WScript.Echo("12")WScript.Echo("13")WScript.Echo("14")WScript.Echo("15")WScript.Echo("16")WScript.Echo("17")WScript.Echo("18")WScript.Echo("19")WScript.Echo("20")WScript.Echo("21")WScript.Echo("22")WScript.Echo("24") WScript.Echo("25") WScript.Echo("26") WScript.Echo("27") WScript.Echo("28") WScript.Echo("29") WScript.Echo("30") WScript.Echo("31") WScript.Echo("32") WScript.Echo("33") WScript.Echo("34") WScript.Echo("35") WScript.Echo("36") WScript.Echo("37") WScript.Echo("38") WScript.Echo("39") WScript.Echo("40") WScript.Echo("41") WScript.Echo("42") WScript.Echo("43") WScript.Echo("44") WScript.Echo("45") WScript.Echo("46") WScript.Echo("47") WScript.Echo("48") WScript.Echo("49") WScript.Echo("50") WScript.Echo("51") WScript.Echo("52") WScript.Echo("53") WScript.Echo("54") WScript.Echo("55") WScript.Echo("56") WScript.Echo("57") WScript.Echo("58") WScript.Echo("59") WScript.Echo("60") WScript.Echo("61") WScript.Echo("62") WScript.Echo("63") WScript.Echo("64") WScript.Echo("65") WScript.Echo("66")WScript.Echo("68")WScript.Echo("69")WScript.Echo("70")WScript.Echo("71")WScript.Echo("72")WScript.Echo("73")WScript.Echo("74")WScript.Echo("75")WScript.Echo("76")WScript.Echo("77")WScript.Echo("78")WScript.Echo("79")WScript.Echo("80")WScript.Echo("81")WScript.Echo("82")WScript.Echo("83")WScript.Echo("84")WScript.Echo("85")WScript.Echo("86")WScript.Echo("87")WScript.Echo("88")WScript.Echo("89")WScript.Echo("90")WScript.Echo("91")WScript.Echo("92")WScript.Echo("93")WScript.Echo("94")WScript.Echo("95")WScript.Echo("96")WScript.Echo("97")WScript.Echo("98")WScript.Echo("99")WScript.Echo("100")msgbox("好吧,看你按得挺辛苦的份上,这题算你通过了,接受下一题的考验吧")on error resume nextdim WSHshellAset WSHshellA = wscript.createobject("wscript.shell")WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""说我是2B,不说就1分钟后关你机,不信,试试···建议先保存文件,我给足你保存时间了,否则后果自负"" ",0 ,truedim ado while(a <> "我是2B")a = inputbox ("说我是2B,就不关机,快撒,说""我是2B"" ","说不说","",6000,6000) msgbox chr(13) + chr(13) + chr(13) + "不说就关机",0,"MsgBox"loopmsgbox chr(13) + chr(13) + chr(13) + "早说就行了嘛"dim WSHshellset WSHshell = wscript.createobject("wscript.shell")WSHshell.run "cmd.exe /c shutdown -a",0 ,truemsgbox chr(13) + chr(13) + chr(13) + "算了,看你这么辛苦,不关你计算机了,放你一马,切记下次不要手贱哦*^__^*"。
56. VB整人小程序:让整个屏幕雪花飘飘这是我以前写的小程序雪花飘飘的改进,本程序是一个模拟下雪的小程序:大小不同随风飘荡的雪花从屏幕上方不断落下,飘满整个屏幕。
雪花可在任何窗口上飘荡,包括任务栏、开始菜单、弹出菜单等地方。
原“雪花飘飘”小程序采用了移动 Label 控件的方式模拟飘荡的雪花,雪花只能在程序所在窗口内移动,无法飘荡到其他程序、开始菜单等窗口的上面,并且雪花的移动不流畅。
本程序采用在窗口上显示字符、使窗口最大化、窗口背景透明的方式,克服了上述缺点。
实际上,是本程序无边框的最大化窗口遮住了屏幕上其他所有窗口,使雪花可飘荡到屏幕任何地方。
但是,透明的背景让用户仍然可以看到其他程序,并可以进行正常操作。
本程序编译成 exe 文件运行后,只能通过系统“任务管理器”才能终止运行。
程序运行效果截图如下:''以下是窗体代码,在 VB6 调试通过:'' 注意:在属性窗口将窗体的 BorderStyle 属性设置为 0,即窗体是无边框窗体'' 在窗体上放置一个控件:Timer1,不必设置任何属性''本人原创,转载请注明文章来源:/100bd/blog/item/fdfe29315c32dd88a9018e94.html Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As LongPrivate Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As LongPrivate Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByValdwNewLong As Long) As LongDim ctSnow() As tySnow, ctSnowS As Long, ctSeChange As LongPrivate Type tySnow'定义表示雪花的数据类型X As Single: xV As Single 'x 坐标、水平移动速度Y As Single: yV As Single 'y 坐标、垂直移动速度Se As Long: Size As Single'雪花颜色、大小End TypePrivate Sub Form_Load()ctSnowS = 200 '300 '雪花数量ctSeChange = 30'雪花颜色的变化范围'最大化窗口。
python实现雪花飘落效果实例讲解在学习pygame模块过程中,我们可以通过使⽤ pygame模块实现很多功能性的东西,但是很多⼈应该没有利⽤pygame实现过雪花飘落的效果吧,有时候可能是不知道从何⼊⼿或者是没有时间写,接下来我就教⼤家如何利⽤pygame模块实现雪花飘落的效果吧,总共都⽤不到40⾏代码就可以实现哦,希望对你们有所帮助第⼀步:我们先打开我们的pycharm软件,然后新建⼀个Python⽂件第⼆步:建⽴好⽂件之后,我们在编辑页⾯输⼊以下代码:import pygameimport sys #导⼊模块import random#设置窗体图形界⾯screen = pygame.display.set_mode((700,500)) #设置窗体的屏幕宽⾼,screen变量接收屏幕pygame.display.set_caption("吴秀柔 16级计科2班") #设置窗体的标题#雪花snowImage='image/snow.png' #定位图⽚snowStart=pygame.image.load(snowImage) #加载图⽚#定义⼀个图像和雪花列表imagelist=[]snowlist=[]#绘制初始化雪花for i in range(20):# 随机给出雪花在窗体上,⼀次可以显⽰的个数x = random.randint(0,600) #参数1为上限,参数2为下限y = random.randint(0,450)snowlist.append(random.randint(1,2)) #雪花下落的速度imagelist.append([x,y]) # 保存随机获得的位置#绘制雪花在窗体上while True:screen.fill((0,0,0)) #设置窗体的背景为⿊⾊# 消息事件循环,判断退出for event in pygame.event.get(): #获得⼀个事件的列表if event.type == pygame.QUIT: #如果事件类型,退出sys.exit() #安全退出num=0for y in imagelist: # 雪花列表循环,从y轴的上限往下限⽅向飘落y[1]=y[1]+snowlist[num] #改变Y轴坐标,移动雪花位置num+=1screen.blit(snowStart,(y[0],y[1])) # 打印雪花if y[1]>=500: #当雪花达到下限,落出屏幕之后,重设位置y[1]=-snowStart.get_height() #重设Y轴的坐标到0以上,从⽽使得雪花下⼀次循环有效pygame.display.update() # 刷新画⾯第三步:写好我们的代码之后,我们直接同时按住键盘上的Ctrl+shift+F10或者⿏标右键,找到“run”,进⾏程序的运⾏编译第四步:运⾏之后就可以看到我们的雪花飘落的效果了。
AtionScrip 3.0制作雪花飘飘动画Webjx核心提示:本例为用Flash AtionScrip 3.0制作雪花飘飘的雪景效果,常常从网上的动画中看到大雪纷飞的场面,看到雪花从天空中拖曳而下,真有一种身临其境的感觉呢?但主要是用AtionScrip 2.0制作,现在我们用AtionScrip 3.0来制作雪景效果.二、制作背景回到场景 1 中来,选择【文件】-【导入】-【导入到舞台】,从自己的磁盘中选择一张雪景图片,选中图片,把它设置为550x400,全居中,同时把图层 1 更名为“背景”。
三、新建一个图层“AS” ,点中第 1帧,打开“动作”面板,添加下列代码:Var sj:Timer=new Timer(Math.random()*300+100,100);//声明一个时间变量,类型Timer,随机设置时间间隔和控制雪花数量;sj.addEventListener(TimerEvent.TIMER ,sjcd);//用sj来侦听时间事件;function sjcd(event:TimerEvent) {//声明一个sjcd函数var xh:xh_mc=new xh_mc();//先声明一个对象xh,类型xh_mc,等于一种新类型xh_mc;addChild(xh);//把新声明的xh对象显示到舞台上;xh.x=Math.random()*550;//雪花x坐标在550舞台上随机出现;xh.y=Math.random()*200;//雪花y坐标控制在舞台上的0-200处随机出现;xh.alpha=Math.random()*1+0.2;//雪花的随机透明度;xh.scaleX=Math.random()*0.5+0.5;//随机控制雪花在x的宽度;xh.scaleY=Math.random()*0.5+0.5;//随机控制雪花在y的宽度;}sj.start();//时间开始;雪景代码:flash鼠标跟随代码谁能帮我翻译下下面的代码,谢谢了!startDrag(mc,true);Mouse.hide();var i:Number = 0;onMouseMove = function(){attachMovie("mc","mc"+i,i);this["mc"+i]._x = _xmouse;this["mc"+i]._y = _ymouse;i+=1};mc为屏幕中的剪辑对象startDrag(mc,true);//MC可拖动,拖动点为MC的中心Mouse.hide();//隐藏鼠标var i:Number = 0;//定义变量i,值为0onMouseMove = function(){//当鼠标移动时attachMovie("mc","mc"+i,i);//从库中加载链接名为mc的元件到屏幕中作为实例,命名为mc+1 this["mc"+i]._x = _xmouse;this["mc"+i]._y = _ymouse;//这些实例与鼠标坐标位置相同i+=1//随着鼠标移动,实例数量递增};。
javascript实现雪花飘落效果圣诞节快到了相信许多公司的前端都在会收到⼀个需求,那就是做⼀个关于圣诞节的专题,⽽这个专题为了应对圣诞节这个主题都会加上雪花飘呀飘这个⼩动画,当然我们公司也不例外,下⾯就是本⼈⽤js写的⼀⼩段雪花秀啦:<!DOCTYPE html><html><head><meta charset="UTF-8"><title></title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"><script src="jquery-1.8.3.min.js"></script></head><style>html{max-width: 720px;}body{width: 100%;height: 100%;margin: 0 auto;overflow-x: hidden;}.snow{width: 100%;height: 100%;background: pink;overflow: hidden;}.snow_img{position: absolute;top: -50px;margin-left: 1px;}</style><body><div class="snow"></div><script>$(function(){$('body').css("height",$(window).height())var wid=$(".snow").width();var html_snow="<img src='snow.png' class='snow_img'>";setInterval(function(){$(".snow").append(html_snow);snowFlow();},100);function snowFlow(){$(".snow_img").each(function(index){var snow_time=(Math.random()*10+4)*1000;var wid_snow=Math.floor(Math.random()*40+5)+'px';var float_left=Math.random()*wid*2-wid+"px";var wid_left=Math.random()*wid+"px";if( $(this).css("margin-left")==1+"px"){$(this).css("margin-left",wid_left);}if($(this).width()==0 || $(this).width()==50 ){$(this).width(wid_snow);}$(this).animate({top:800+"px",left:float_left,},snow_time);if($(this).offset().top==800){$(this).remove();}})}});</script></body></html>代码很简单,都是运动⽤js的⼀些基础知识点做出来的,主要是随机数和⼀些判断。
当前位置:首页>VB 小程序> 让整个屏幕雪花飘飘(改进)58. VB整人小程序:让整个屏幕雪花飘飘(改进)这是我以前写的小程序让整个屏幕雪花飘飘的改进,本程序是一个模拟下雪的小程序:大小不同随风飘荡的雪花从屏幕上方不断落下,飘满整个屏幕。
雪花可在任何窗口上飘荡,包括任务栏、开始菜单、弹出菜单等地方。
本程序与原程序的主要改进之处是:落下的雪花不会消失,会在屏幕底部不断堆积,双击屏幕底部的积雪可使积雪消失。
本程序编译成 exe 文件运行后,只能通过系统“任务管理器”才能终止运行。
程序运行效果截图如下:'' '本程序包含两个窗体,Form1 和 Form2,其中 Form1 是启动窗体。
代码在在 VB6 调试通过:''下面是 Form1 窗体代码:====================================='' 注意:在属性窗口将窗体的 BorderStyle 属性设置为 0,即窗体是无边框窗体'' 在窗体上放置一个控件:Timer1,不必设置任何属性''本人原创,转载请注明文章来源:/100bd/blog/item/fbb5bdd5f0564910a08bb740.html Private Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As LongPrivate Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As LongPrivate Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongDim ctSnow() As tySnow, ctSnowS As Long, ctSeChange As LongPrivate Type tySnow '定义表示雪花的数据类型X As Single: xV As Single 'x 坐标、水平移动速度Y As Single: yV As Single 'y 坐标、垂直移动速度Se As Long: Size As Single '雪花颜色、大小End TypePrivate Sub Form_Load()ctSnowS = 200 '300 '雪花数量ctSeChange = 30 '雪花颜色的变化范围'最大化窗口。
注意:不要用在属性窗口设置 WindowState 属性的方'式,也不使用 Me.WindowState = 2 代码。
否则,在用户调整任务'栏状态的时候,会造成积雪的位置错位。
Me.WindowState = 0Me.Move 0, 0, Screen.Width, Screen.HeightReDim ctSnow(1 To ctSnowS)Me.Caption = "雪花飘飘"Me.AutoRedraw = True: Me.ScaleMode = 3Me.BackColor = RGB(235 - ctSeChange * 2, 235 - ctSeChange * 2, 255) Call TransWin(Me.hWnd, Me.BackColor) '将窗口背景色设置为透明的Form2.AutoRedraw = True: Form2.ScaleMode = 3Form2.BackColor = Me.BackColorForm2.Move Form1.Left, Form1.Top, Form1.Width, Form1.HeightCall TransWin(Form2.hWnd, Form2.BackColor) '将窗口背景色设置为透明的Form2.ShowTimer1.Enabled = True: Timer1.Interval = 20End SubPrivate Sub Timer1_Timer()Dim I As Long, V As Single, H1 As Single, IsDown As Boolean, Se As LongV = 8 '修改此数字,可改变雪花整体飘荡的速度Randomize '初始化随机发生器WinInTop Me.hWnd, True '使雪花(窗口)显示在最前,包括显示到任务栏上面WinInTop Form2.hWnd, TrueMe.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), Me.BackColor, BF For I = 1 To ctSnowSctSnow(I).X = ctSnow(I).X + ctSnow(I).xV * VctSnow(I).Y = ctSnow(I).Y + ctSnow(I).yV * VIf Rnd * 20 < 1 Then ctSnow(I).xV = Rnd - 0.5 '改变水平移动速度,模拟随风飘荡If ctSnow(I).Size = 0 Or ctSnow(I).Y > Me.ScaleHeight Then Call SnowInit(I) '未初始化,或超出下边界' ctSnow(I).Size = 2 '****调试代码ShowStr Me, I '画一朵雪花Me.Font.Size = ctSnow(I).SizeH1 = Me.TextHeight("*") * 0.5 '半个字符高度If ctSnow(I).X < -H1 Then ctSnow(I).X = Me.ScaleWidth '超出左边界If ctSnow(I).X > Me.ScaleWidth Then ctSnow(I).X = -H1 '超出右边界'最下层积雪位置IsDown = ctSnow(I).Y > Me.ScaleHeight - H1If IsDown Then ctSnow(I).Y = Me.ScaleHeight - H1'积雪密度:Y 坐标后 H1*0.9 数值越小密度越大'数值过大,如 H1*1.5,会使积雪堆积成柱状或造成空隙。
'数值过小,如 H1*0.5,会使积雪堆积速度缓慢。
Se = Form2.Point(ctSnow(I).X + H1 * 0.5, ctSnow(I).Y + H1 * 0.9) If Se > -1 And Se <> Form2.BackColor Then IsDown = True'已落到最下面,在 Form2 的相同位置绘制积雪If IsDown ThenShowStr Form2, ICall SnowInit(I)If ctSnow(I).Y > Me.ScaleHeight * 0.9 ThenForm2.Font.Size = 12Form2.CurrentX = (Me.ScaleWidth - 8 * Me.TextHeight("12")) * 0.5Form2.CurrentY = Me.ScaleHeight * 0.92Form2.ForeColor = RGB(0, 0, 255)Form2.Print "双击此处消除积雪"End IfEnd IfNextEnd SubPrivate Sub ShowStr(Kj, I As Long)'画一朵雪花Dim H1 As SingleKj.Font.Size = ctSnow(I).SizeKj.CurrentX = ctSnow(I).XKj.CurrentY = ctSnow(I).YKj.ForeColor = ctSnow(I).SeIf ctSnow(I).Size > 4.2 ThenKj.Print "*"ElseIf ctSnow(I).Size > 3 Then Kj.DrawWidth = 2 Else Kj.DrawWidth = 1H1 = Kj.TextHeight("*") * 0.5Kj.PSet (ctSnow(I).X + H1 * 0.5, ctSnow(I).Y + H1 - 1)End IfEnd SubPrivate Sub SnowInit(I As Long)'初始化一朵雪花Dim S As SinglectSnow(I).X = Rnd * Me.ScaleWidthctSnow(I).xV = Rnd - 0.5ctSnow(I).yV = Rnd * 0.5 + 0.1S = 2 + Rnd * 9 '字体最大 11 号If ctSnow(I).Size = 0 ThenctSnow(I).Y = Rnd * Me.ScaleHeightElseMe.Font.Size = SctSnow(I).Y = -Me.TextHeight("*")End IfctSnow(I).Size = SS = 235 - ctSeChange * 2 + Int(Rnd * ctSeChange * 2)ctSnow(I).Se = RGB(S, S, 255) '雪花略带蓝色,否则在白背景时将看不见End SubPrivate Sub TransWin(hWnd As Long, TransColor As Long)'将窗口颜色 TransColor 设置为透明的Dim ExsTyle As LongConst WS_EX_LAYERED = &H80000, GWL_ExsTyle = -20ExsTyle = WS_EX_LAYERED Or GetWindowLong(hWnd, GWL_ExsTyle)SetWindowLong hWnd, GWL_ExsTyle, ExsTyleSetLayeredWindowAttributes hWnd, TransColor, 0, 1End SubPrivate Sub WinInTop(nWnd As Long, Optional InTop As Boolean) '窗口保持最前Const HWND_NoTopMost = -2 '取消在最前Const HWND_TopMost = -1 '最上Const SWP_NoSize = &H1 'wFlags 参数Const SWP_NoMove = &H2Const SWP_NoZorder = &H4Const SWP_NoActivate = &H10 '不激活窗口Const SWP_ShowWindow = &H40Const SWP_HideWindow = &H80Dim nIn As LongIf InTop Then nIn = HWND_TopMost Else nIn = HWND_NoTopMostSetWindowPos nWnd, nIn, 0, 0, 0, 0, SWP_NoSize + SWP_NoMove + SWP_NoActivateEnd Sub''下面是Form2 窗体代码:====================================='' 注意:在属性窗口将窗体的BorderStyle 属性设置为0,即窗体是无边框窗体Private Sub Form_DblClick()'双击清除积雪Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), Me.BackColor, BFEnd Sub。