VB做个简单的图片浏览器

来源:百度知道 编辑:UC知道 时间:2024/06/14 08:17:20
期末考试~~ 兄弟 帮帮忙...课上我照书打了段编码~~ 怎么都是错的 高手帮帮看看。..打段对的给我 兄弟这感激不及啊~~~~~
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub file1_Click()
ChDrive Drive1.Drive
ChDir Dir1.Path
With Picture2
Picture2.Height = 2600
Picture2.Left = 0
Picture2.Top = 0
Picture2.Width = 2300
Picture2.Picture = LoadPicture(File1.FileName)
End With
VScroll1.Max = Picture2.Height - 2600: HScroll1.Max = Picture2.Width - 2300
VScroll1.Value = 0: HScroll1.Value = 0
End Sub

Private Sub HScroll1_Change()
Picture2.Left = 0 - HScroll1.Value
End Sub

Private Sub VScroll1_Change()
Picture2.Top = 0 - HScroll1.Value
End Sub
高手帮忙指个错 打断对的来// 考试用..谢哈 ~~

Private Sub Form_Load()
File1.Pattern = "*.bmp;*.jpg;*.gif"
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()
ChDrive Drive1.Drive
ChDir Dir1.Path
Picture2.Height = 2600
Picture2.Left = 0
Picture2.Top = 0
Picture2.Width = 2300
Picture2.Picture = LoadPicture(File1.filename)

VScroll1.Max = Picture2.Height - 2600: HScroll1.Max = Picture2.Width - 2300
VScroll1.Value = 0: HScroll1.Value = 0
End Sub

Private Sub HScroll1_Change()
Picture2.Left = 0 - HScroll1.Value
End Sub

Private Sub VScroll1_Change()
Picture2.Top = 0 - HScroll1.Value
End Sub