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

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

瀏覽文件夾中的圖片

[摘要]首先要新建一個工程,在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環境下調試通過。


主站蜘蛛池模板: 日本久久99 | 日韩中文字幕在线不卡 | 天天躁夜夜躁狂狂躁综合 | 欧美性野久久久久久久久 | 性久久久久久久久 | 香蕉在线视频网站 | 青娱分类视频精品免费2 | 最新精品女神在线观看 | 日韩亚洲欧美在线 | 色综合久久婷婷天天 | 欧美一级xxxx俄罗斯一级 | 亚洲婷婷在线 | 色婷婷综合和线在线 | 三上悠亚久久国产 | 亚洲精品午夜在线观看 | 日韩毛片久久91 | 天天看天天爽天天摸天天添 | 四虎影院免费观看视频 | 亚洲欧洲eeea在线观看 | 欧美五月| 伊人久久婷婷丁香六月综合基地 | 欧美视频一级 | 中文字幕激情视频 | 亚洲aaa视频 | 色天使色护士 在线视频观看 | 亚洲精品永久免费 | 青青草国产在线视频 | 青春草影院 | 色版网站| 日本高清视频网站www | 亚洲日本在线观看网址 | 天天干夜夜爽天天操夜夜爽视频 | 最近最新免费中文字幕一 | 亚洲最大成人网色 | 亚韩在线 | 日本人的一区二区三区四区 | 日本免费高清视频 | 亚洲成在人天堂在线 | 香蕉免费一区二区三区 | 亚洲精品午夜在线观看 | 欧美一区二区aa大片 |