济南省中医院地址在哪:哪位哥哥姐姐能帮我用VB6.0编一个“图片浏览器”???

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 12:05:57
我用VB6.0编一个“图片浏览器”
老师布置的作业 ~0~
希望各哥哥姐姐们帮帮小弟
小弟万分感谢~~~

Dim i As Integer
Private Sub Command1_Click()
Timer1.Interval = 6000
End Sub

Private Sub Command2_Click()
Timer1.Interval = 0
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Form_Load()
i = 0
End Sub

Private Sub Timer1_Timer()
Dim a As String
a = App.Path
If Right$(a, 1) <> "\" Then a = a & "\"
i = i + 1
Image1.Picture = LoadPicture(a & "xy" & ".bmp")
If i = 5 Then i = 0

End Sub

具体还是自己看书或者下载源代码吧!
www.vbgood.com里面有!

你是谁呀。我那有,有事给我发邮件吧
nannan064@163.com

不是很难啊!!这些简单的东西自己去尝试一下效果会更好的

我这儿正好有个,不过是我1年前写的!
将以下代码保存为form1.frm用VB打开,再每个img(index)里添加你喜欢的图片运行就可以了!

''''''''''''''''''form1.frm''''''''''''''''''

VERSION 5.00
Begin VB.Form Form1
AutoRedraw = -1 'True
BackColor = &H00000000&
Caption = "Form1"
ClientHeight = 3510
ClientLeft = 5490
ClientTop = 3795
ClientWidth = 4620
LinkTopic = "Form1"
ScaleHeight = 234
ScaleMode = 3 'Pixel
ScaleWidth = 308
Begin VB.PictureBox Picture1
Height = 3000
Left = 750
ScaleHeight = 196
ScaleMode = 3 'Pixel
ScaleWidth = 196
TabIndex = 0
Top = 240
Width = 3000
Begin VB.Image img
Height = 3000
Index = 20
Left = 0
Picture = "Form1.frx":0000
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 19
Left = 0
Picture = "Form1.frx":2EB2
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 18
Left = 0
Picture = "Form1.frx":6534
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 17
Left = 0
Picture = "Form1.frx":8133
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 16
Left = 0
Picture = "Form1.frx":AE0C
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 15
Left = 0
Picture = "Form1.frx":F734
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 14
Left = 0
Picture = "Form1.frx":12DE7
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 13
Left = 0
Picture = "Form1.frx":15719
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 12
Left = 0
Picture = "Form1.frx":1885D
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 11
Left = 0
Picture = "Form1.frx":1C8A2
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 10
Left = 0
Picture = "Form1.frx":1F69A
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 9
Left = 0
Picture = "Form1.frx":22134
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 8
Left = 0
Picture = "Form1.frx":25323
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 7
Left = 0
Picture = "Form1.frx":29D8C
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 6
Left = 0
Picture = "Form1.frx":2CF5E
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 5
Left = 0
Picture = "Form1.frx":2EA3B
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 4
Left = 0
Picture = "Form1.frx":31A24
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 3
Left = 0
Picture = "Form1.frx":34645
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 2
Left = 0
Picture = "Form1.frx":377CB
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 1
Left = 0
Picture = "Form1.frx":3B81E
Stretch = -1 'True
Top = 0
Visible = 0 'False
Width = 3000
End
Begin VB.Image img
Height = 3000
Index = 0
Left = 0
Picture = "Form1.frx":3FD06
Stretch = -1 'True
Top = 0
Width = 3000
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Form_Click()
Call Form1.Refresh
End Sub

Private Sub Form_Load()
On Error Resume Next
Form1.BackColor = vbBlack
Form1.Show
DoEvents
For i = 0 To 20
img(i).Visible = False
Next i
Call p
Sleep (1000)
For i = 0 To 20
img(i - 1).Visible = False
Picture1.Refresh
img(i).Visible = True
DoEvents
Sleep (1000)
Call p
Next i
Picture1.Refresh
End Sub
Private Sub p()
For j = 0 To 200 Step 2
For i = 0 To 200 Step 1
Picture1.PSet (i, j), vbBlack
Next i
Next j
Sleep (1000)
End Sub