1樓:匿名使用者
你在窗體上新增三個command,和乙個shape,其它什麼都不用管了,然後輸入以下**就可以了:
private sub command1_click()if shape1.shape >= 5 thenshape1.shape = 0
else
shape1.shape = shape1.shape + 1end if
end sub
private sub command2_click()if shape1.fillstyle >= 7 thenshape1.fillstyle = 0
else
shape1.fillstyle = shape1.fillstyle + 1
end if
end sub
private sub command3_click()static i as integer
if i >= 15 then
i = 0
shape1.backcolor = qbcolor(i)else
i = i + 1
shape1.backcolor = qbcolor(i)end if
end sub
private sub form_load()command1.caption = "切換形狀"
command2.caption = "切換填充樣式"
command3.caption = "切換填充色"
shape1.backstyle = 1
end sub
2樓:
新建vb工程,在form1中加入shape控制項,line控制項,time控制項,加入一下**:
dim h%
const l = 270
const t = 120
private sub form_load()me.height = 7650
me.width = 9930
shape1.move 3360, 5640, 1095, 855shape1.backstyle = 1
shape1.backcolor = vbredline1.x1 = 3840
line1.x2 = 3840
line1.y1 = 6960
line1.y2 = 6480
timer1.interval = 150end sub
private sub timer1_timer()h = h + 1
if shape1.top <= 120 thentimer1.enabled = falseend if
if h mod 2 = 0 then
shape1.left = shape1.left - lline1.x1 = line1.x1 - lline1.x2 = line1.x2 - lelse
shape1.left = shape1.left + lline1.x1 = line1.x1 + lline1.x2 = line1.x2 + lend if
shape1.top = shape1.top - tline1.y1 = line1.y1 - tline1.y2 = line1.y2 - tend sub
vb程式設計應用二維陣列產生隨機矩陣55並實現矩陣
珈藍惜夢 vb源程式如下 option base 1 private sub command1 click dim a 5,5 as integer,b 5,5 as integer for x 1 to 5 for y 1 to 5 a x,y int 10 rnd 90 隨機產生兩位數的整數 p...
急需乙份關於電機拆裝與檢修的實訓報告
電機拆裝與檢修 一 電機的定義及分類 1 電動機是根據電磁感應原理,把電能轉換為機械能,並輸出機械轉矩的原動機。2 分類 二 電動機常見故障分析及判斷 電機常見故障主要分機械故障和電氣故障兩大類。按電流分 直流交流 同步非同步 單相三相 繞線式鼠籠式 3 電機的結構 主要分為定子和轉子。機械故障主要...
大學VB座標象限按要求與步驟的怎麼程式設計
private sub command1 click if text1.text 0 or text2.text 0 then text3.text 該座標在座標軸上,不在象限內!exit sub end if if text1.text 0 and text2.text 0 then text3....