高手来指点迷津,万分感谢!
我是新手,最近用VB编一个图片浏览特效工程,,在编译时老是提示:VB中错误的参数号或无效的属性赋值请高手救助,感激不尽!
代码如下:
使用的控件有:driver1,picture1,dir1,file1,frame1,option1~option4,text1,command1
Private Sub Command2_Click()
End
End Sub
------------------------------------------------------------------
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
--------------------------------------------------------------------
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
--------------------------------------------------------------------
Private Sub File1_Click()
Dim str, fullname As String
str = Dir1.Path
If Right(str, 1) = "\" Then str = "" Else str = "\"
fullname = Dir1.Path & str & File1.FileName
Text1.Text = fullname
Image1.Visible = False
Image1.Picture = LoadPicture(fullname)
Picture1.Cls
If option1.Value = ture Then
directshow
ElseIf Option2.Value = ture Then
rollshow
ElseIf Option3.Value = ture Then
crossshow
ElseIf Option4.Value = ture Then
rainshow
End If
End Sub
---------------------------------------------------------
Private Sub Form_Load()
Text1.Text = ""
File1.Pattern = "*.bmp;*.gif;*.jpg;*.ico"
option1.Value = True
End Sub
-----------------------------------------------------------
Public Sub directshow()
Picture1.PaintPicture Image1.Picture, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, 0, 0, Image1.Width,Image1.Height, vbSrcCopy
End Sub
-------------------------------------------------------------------------------------------------------
Public Sub rollshow()
Dim i, p As Integer
Dim pp, pi
p = 40
pp = Picture1.ScaleHeight
pi = Image.Height / p
For i = 0 To p
Picture1.PaintPicture Image1.Picture, 0, pp * i, Picture1.ScaleWidth, pp, 0, , pp * i, Image1.Width, pi, vbSrcCopy
delay 500
Next
End Sub
-----------------------------------------------------------------------------------------------------
Public Sub crossshow()
Dim i, p As Integer
Dim pp, pi
p = 80
pp = Picture1.ScaleWidth / p
pi = Image.Height / p
For i = 0 To p Step 2
Picture1.PaintPicture Image1.Picture, pp * i, 0, pp, Picture1.ScaleHeight, pp * i, 0, pi, Image1.Height, vbSrcCopy
delay 500
Next
End Sub
-------------------------------------------------------------------------------------
Public Sub rainshow()
Dim i, p, j As Integer
Dim pp, pi
p = 40
pp = Picture1.ScaleHeight / p
pi = Image.Height / p
For i = 0 To p - 1
For j = p - 1 To i Step -1
Picture1.PaintPicture Image1.Picture, 0, pp * j, Picture1.ScaleWidth, pp, 0, , pp * i, Image1.Width, pi, vbSrcCopy
Next
delay 500
Next
End Sub
--------------------------------------------------------------------------------------------------------
Public Sub delay(ByVal t As Integer)
Do While t > 0
t = t - 1
DoEvents
Loop
End Sub
请你给编译一下,指点迷津!谢谢!
出错地方在:
Public Sub rollshow()
Dim i, p As Integer
Dim pp, pi
p = 40
pp = Picture1.ScaleHeight
pi = Image.Height / p
For i = 0 To p
Picture1.PaintPicture Image1.Picture, 0, pp * i, Picture1.ScaleWidth, pp, 0, , pp * i, Image1.Width, pi, vbSrcCopy
delay 500
Next
End Sub
其中的:Picture1.PaintPicture --------------------编程问答-------------------- --------------------编程问答-------------------- Picture1.PaintPicture Image1.Picture, 0, pp * i, Picture1.ScaleWidth, pp, 0, , pp * i, Image1.Width, pi,
多了个逗号改成
Picture1.PaintPicture Image1.Picture, 0, pp * i, Picture1.ScaleWidth, pp, 0, pp * i, Image1.Width, pi, --------------------编程问答-------------------- 先不要编译,直接按F5执行一下看看错误在哪一句吧 --------------------编程问答-------------------- Picture1.PaintPicture Image1.Picture, 0, pp * i, Picture1.ScaleWidth, pp, 0, , pp * i, Image1.Width, pi,
多了个逗号改成
Picture1.PaintPicture Image1.Picture, 0, pp * i, Picture1.ScaleWidth, pp, 0, pp * i, Image1.Width, pi, --------------------编程问答-------------------- 测试的结果和楼上一样,多打了一个逗号.去掉就正常
--------------------编程问答--------------------
的确~ 写代码的时候要小心+小心,千万注意别敲错了,可是错误也难免不是~~ 可是错误就是能给你捣乱...
细心点就好了,这都不是问题
补充:VB , 网络编程