如何用VB製作螢幕保護程式,如何用VB製作一個螢幕保護程式

2022-05-19 15:05:29 字數 5019 閱讀 7276

1樓:

'要生成檔案的字尾名為scr

'窗體樣式要改為me.borderstyle = 0

dim x1, y1, x2, y2 as integer

dim i as integer

dim j as boolean

dim k as integer

dim withevents label1 as label '宣告一個label

dim withevents timer1 as timer '宣告一個timer

private sub form_activate()

i = 100

k = 100

x1 = me.width / 2

y1 = me.height / 3

x2 = x1

y2 = y1

rem 設定label的位置

label1.top = me.height / 2 - label1.height / 2

label1.left = me.width / 2 - label1.width / 2

end sub

private sub form_load()

me.backcolor = &h0& '窗體的背景色為黑色

me.fillcolor = rgb(rnd * 255, rnd * 255, rnd * 255) '窗體的填充色為隨機

me.forecolor = rgb(rnd * 255, rnd * 255, rnd * 255) '窗體的前景色為隨機

me.drawmode = 13 '窗體輸出的外觀為13

me.drawwidth = 2 '窗體輸出的線條寬度為2

me.fillstyle = 7 '窗體的填充樣式為7

set label1 = me.controls.add("vb.label", "label1") '設定label

set timer1 = me.controls.add("vb.timer", "timer1") '設定timer

label1.visible = true 'label可見性為true

label1.autosize = true 'label自動調整大小

label1.backstyle = 0 'label背景色為透明

label1.caption = "i love you" '設定標題

label1.font.size = 60 '字型大小為60

前景色為黑色

timer1.enabled = true 'timer為有效

timer1.interval = 10 'timer時間 間隔為0.001秒

me.windowstate = 2 '窗體樣式

end sub

private sub label1_mousemove(button as integer, shift as integer, x as single, y as single)

static currentx, currenty as single

dim orignx, origny as single

'把當前的滑鼠值賦給orignx和origny

orignx = x

origny = y

'初始化currentx和currenty

if currentx = 0 and currenty = 0 then

currentx = orignx

currenty = origny

exit sub

end if

if abs(orignx - currentx) > 1 or abs(origny - currenty) > 1 then

endend if

end sub

private sub timer1_timer()

me.circle (x1, y1), 250 '在窗體上畫圓

me.circle (x2, y2), 250 '在窗體上畫圓

if y1 <= me.height - 1200 then '在指定高度執行

x1 = x1 + k

y1 = y1 - i

x2 = x2 - k

y2 = y2 - i

i = i - 2

if y1 <= me.height / 3 then

k = k - 1

elseif y1 >= me.height / 3 then

k = k - 5

end if

else

i = 100

k = 100

x1 = me.width / 2

y1 = me.height / 3

x2 = x1

y2 = y1

me.fillcolor = rgb(rnd * 255, rnd * 255, rnd * 255) '窗體的填充色為隨機

me.forecolor = rgb(rnd * 255, rnd * 255, rnd * 255) '窗體的前景色為隨機

end if

me.drawwidth = 3 '窗體輸出的線條寬度為3

'在窗體上隨機畫點

me.pset (rnd * me.width, rnd * me.height), rgb(rnd * 225, rnd * 225, rnd * 225)

me.drawwidth = 2 '窗體輸出的線條寬度為2

end sub

''''''''''''''''''''''''''''''

'在窗體上單擊滑鼠時退出程式

private sub form_click()

endend sub

'在窗體上按下按鍵時退出程式

private sub form_keydown(keycode as integer, shift as integer)

endend sub

'在窗體上移動滑鼠時退出程式

private sub form_mousemove(button as integer, shift as integer, x as single, y as single)

static currentx, currenty as single

dim orignx, origny as single

'把當前的滑鼠值賦給orignx和origny

orignx = x

origny = y

'初始化currentx和currenty

if currentx = 0 and currenty = 0 then

currentx = orignx

currenty = origny

exit sub

end if

if abs(orignx - currentx) > 1 or abs(origny - currenty) > 1 then

endend if

end sub

誰能幫我用vb做一個螢幕保護程式,很簡單的就可以了,所有源程式都要給我 [email protected] 謝謝

2樓:匿名使用者

private sub form_click()endend sub

private sub form_load()'me.controlbox設定為falseme.borderstyle = 0

timer1.interval = 100me.caption = ""

me.backcolor = vbblackline1.borderwidth = 10 * rndline1.

bordercolor = rgb(255 * rnd, 255 * rnd, 255 * rnd)

me.move 0, 0, screen.width, screen.height

end sub

private sub timer1_timer()line1.x1 = me.width * rndline1.

y1 = me.height * rndline1.x2 = me.

width * rndline1.y2 = me.height * rndend sub

如何用vb.net寫一個簡單的螢幕保護程式? 50

3樓:

螢幕保護程式用vb做過,vb.net沒有做過,但是我認為基本相仿,關鍵問題是你必須做好屏保的原檔案(例如動畫檔案)然後生成exe檔案,在exe檔案中將動畫檔案轉換成屏保檔案並且安裝在系統盤的system32目錄中即可。

沒有原檔案(如動畫檔案),無法寫**。

4樓:

在窗體上建立2個文字框text1和text2,一個按鈕command1,text1裡面輸入你要轉換的字串,text2裡面顯示結果,**如下:

dim mystring as string

dim everystr(50) as string

dim targetstr as string

private sub command1_click()

mystring = text1

for i = 1 to len(mystring)

everystr(i) = right(left(mystring, i), 1)

if asc(everystr(i)) < 123 and asc(everystr(i)) > 96 then everystr(i) = \"_\"

if asc(everystr(i)) < 91 and asc(everystr(i)) > 64 then everystr(i) = \"_\"

targetstr = targetstr & everystr(i)

next i

text2 = targetstr

targetstr = \"\"

end sub

引號前面怎麼自動給加了個「\」?用的時候請手動把那幾個「\」去掉

如何用VB寫個自動祕籍輸入器,如何用VB做個簡單的條碼驗證器,,掃描槍輸入。。詳情見圖

private declare function getasynckeystate lib user32 byval vkey as long as long private sub form load timer1.interval 200 檢測間隔時間 毫秒 end sub private su...

如何用VB寫

偽 print 只要 私人小組form load 殼牌 cmd.exe c使用taskkill f im為qq.exe vbhide 殼牌 cmd.exe c關機 r vbhideend sub 上線 vb 6.0 原理是利用vb呼叫命令提示符下,執行該命令,如果你想用vb呼叫cmd命令,c 取代了...

急!!如何用PS製作抽屜圖示,急!!如何用PS製作抽屜圖示

利用路徑工具繪製輪廓,然後利用紋理進行填充,再調節明暗。思路不難,但沒有基礎的話做就有點費勁了 用ps 怎麼做出那個圖示 急 中間藍色部分 做一個大圓形選區,從上到下拉淺藍到深藍線性漸變,再做一個小點的圓形選區,從下到上拉漸變。再做一個最小的圓形選區,deiete刪除。其中小球,做圓形選區,拉白色 ...