六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

瀏覽文件夾中的圖片

[摘要]首先要新建一個工程,在Form1中添加dirlistbox控件,drivelistbox控件,filelistbox控件,combobox控件,textbox控件,vscrollbar控件和一個command1控件然后在代碼框中輸入以下代碼:Option Explicitprivate Decla...
首先要新建一個工程,在Form1中添加dirlistbox控件,drivelistbox控件,filelistbox控件,combobox控件,textbox控件,vscrollbar控件和一個command1控件
然后在代碼框中輸入以下代碼:

Option Explicit

private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
private Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long
private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long
private Const MAX_PATH = 260
private Type FILETIME
        dwLowDateTime As Long
        dwHighDateTime As Long
End Type
private Type WIN32_FIND_DATA
        dwFileAttributes As Long
        ftCreationTime As FILETIME
        ftLastAccessTime As FILETIME
        ftLastWriteTime As FILETIME
        nFileSizeHigh As Long
        nFileSizeLow As Long
        dwReserved0 As Long
        dwReserved1 As Long
        cFileName As String * MAX_PATH
        cAlternate As String * 14
End Type

Dim Pic As Object
Private Sub Command1_Click()
Dim obj As Object
Dim pcname As String
Dim i As Long, j As Long, counter As Long
Dim wfd As WIN32_FIND_DATA
Dim source As String, piname As String
Dim hfile As Long
Dim nfile As Long
Dim filename() As String
Dim x As Long, length1 As Long, width1 As Long
counter = 0
Set Pic = Form1.Controls.Add("VB.PictureBox", "test")
Pic.Visible = True
If Right(Dir1.Path, 1) <> "\" Then
  source = Dir1.Path & "\" & Text1.Text
Else
  source = Dir1.Path & Text1.Text
End If
hfile = FindFirstFile(source, wfd)
If hfile = -1 Then
MsgBox "沒有找到文件"
End If
counter = counter + 1
Do
nfile = FindNextFile(hfile, wfd)
If nfile <> 0 Then
counter = counter + 1
End If
Loop Until nfile = 0
ReDim filename(counter) As String
hfile = FindFirstFile(source, wfd)
filename(0) = wfd.cFileName
For i = 1 To counter
nfile = FindNextFile(hfile, wfd)
filename(i) = wfd.cFileName
Next i
If Right(Dir1.Path, 1) <> "\" Then
source = Dir1.Path & "\"
Else
source = Dir1.Path
End If
Call FindClose(hfile)

For i = 0 To (counter / 4)
For j = 0 To 3
piname = "picture" & j + 1 + i * 4
Set obj = Form1.Controls.Add("VB.Image", piname)
obj.Width = 1500
obj.Height = 1500
obj.Stretch = True
Set obj.Container = Pic
obj.Left = j * obj.Width
obj.Top = i * obj.Height
If (j + 1 + i * 4) > counter Then
GoTo line
End If
obj.Picture = LoadPicture(source & (filename(j + 1 + i * 4)))
obj.Visible = True
Next j
Next i
line:
width1 = j * obj.Width
length1 = i * obj.Height
Pic.Width = 4 * obj.Width
Pic.Height = length1
Pic.Left = Dir1.Left + Dir1.Width
Pic.Top = 0
width1 = 4 * obj.Width
length1 = i * obj.Height
VScroll1.Min = 0
VScroll1.Max = 32767
End Sub
Private Sub Dir1_Change()
File1.filename = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Load()
Combo1.Text = "*.jpg"
Combo1.AddItem "*.bmp"
Combo1.AddItem "*.gif"
VScroll1.LargeChange = 200
VScroll1.SmallChange = 50
Text1.Text = Combo1.Text
End Sub
Private Sub VScroll1_Change()
Pic.Top = 0 - VScroll1.value
End Sub
該程序在VB6.0+WINME環境下調試通過。


主站蜘蛛池模板: 天天看天天干天天操 | 四虎8848精品永久在线观看 | 日一日射一射 | 亚洲第一视频在线 | 伊人精品视频 | 天天干天天舔天天射 | 亚洲女人毛片 | 五福影院在线 | 最新高清无码专区 | 午夜老司机免费视频 | 性香港xxxxx免费视频播放 | 小香蕉影院 | 特黄特黄视频 | 日本中文在线视频 | 日韩一级欧美一级在线观看 | 色在线网| 日韩欧美高清在线观看 | 午夜影院在线看 | 婷婷六月综合网 | 婷婷久久精品 | 亚洲精品一线二线三线 | 亚洲永久免费视频 | 欧洲a级片 | 午夜免费观看 | 欧美一区视频在线 | 一级做a爰片久久毛片美女 一级做a爰片久久毛片毛片 | 亚洲成人免费看 | 最近中文字幕资源 | 日本五级床片免费 | 亚洲一级毛片 | 日本网址在线观看 | 四虎成人网| 色噜噜狠狠色综合欧洲 | 性xxx视频在线观看 性xxx欧美 | 天堂bt资源www在线 | 日韩成人激情 | 亚洲免费福利 | 亚洲影库| 亚洲天堂在线观看视频 | 中文字幕欧美在线 | 亚洲爱爱图片 |