
vb中如何让dirvelistbox filelistbox listbox组合起来使用 就是选择路径 举个例子
1个回答
2013-05-17
展开全部
dirvelistbox filelistbox listbox组合?
应该是dirvelistbox filelistbox dirlistbox组合吧?
我做了个选图片的 道理一样控件有dirvelistbox filelistbox dirlistbox,2个command1个Image
Private Sub Command1_Click()
Form12.Image1.Refresh
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
File1.Path = Dir1.Path
End Sub
Private Sub File1_Click()
Dim K As String
If Right(Dir1.Path, 1) <> "/" Then
K = Dir1.Path + "/" + File1.FileName
Else
K = Dir1.Path + File1.FileName
End If
Image1.Picture = LoadPicture(K)
Form11.Image1.Picture = LoadPicture(K)
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
Drive1.Drive = Left(App.Path, 2)
File1.Pattern = "*.bmp;*.jpg;*.gif;*.jepg;*.jpeg"
Image1.Stretch = True
End Sub
自己看看吧
应该是dirvelistbox filelistbox dirlistbox组合吧?
我做了个选图片的 道理一样控件有dirvelistbox filelistbox dirlistbox,2个command1个Image
Private Sub Command1_Click()
Form12.Image1.Refresh
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
File1.Path = Dir1.Path
End Sub
Private Sub File1_Click()
Dim K As String
If Right(Dir1.Path, 1) <> "/" Then
K = Dir1.Path + "/" + File1.FileName
Else
K = Dir1.Path + File1.FileName
End If
Image1.Picture = LoadPicture(K)
Form11.Image1.Picture = LoadPicture(K)
End Sub
Private Sub Form_Load()
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
Drive1.Drive = Left(App.Path, 2)
File1.Pattern = "*.bmp;*.jpg;*.gif;*.jepg;*.jpeg"
Image1.Stretch = True
End Sub
自己看看吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询