百叶窗的VB程序

来源:百度知道 编辑:UC知道 时间:2024/05/05 21:58:14

Option Explicit
Dim i As Integer
Dim m As Integer
Dim w, h As Single
'w和h分别记录图片的宽度和高度
Dim x, y As Single
'x和y分别为取图位置的X坐标和Y坐标
'或者也可以说成是所取区域的宽度和高度
Dim b As Boolean

Private Sub Reset()
w = Picture1.Width
h = Picture1.Height
'保存图片的宽度和高度
Picture2.Width = w
Picture2.Height = h
'根据图片设置Picture2的宽度和高度
'重新设置List1控件的位置
'设置窗口的宽度
Me.Height = h + 700
'设置窗口的高度
'注意留出菜单的高度
b = False
'Stopped
End Sub

Private Sub Timer11_Timer()
m = w / 20
x = x + w / 200
If x > m Then
'Stopped
Picture2.Picture = Picture1.Picture
End If
For i = 0 To 20
Picture2.PaintPicture Picture1.Picture, i * m, 0, , , i * m, 0, x, h
Next
End Sub

Private Sub VWinblind_Click(Index As Integer)