Monday, December 10, 2012

File Directory and Drive control in visual basic


Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub File1_Click()
Image1.Picture = LoadPicture(Dir1.Path & "//" & File1.FileName)
End Sub
Private Sub Form_Load()
File1.Pattern = "*.JPG"
End Sub


 Output


Note:- Please set some property of your control like caption or id corresponding to your control