SETHA SITE INFORMATION

  • Increase font size
  • Default font size
  • Decrease font size

How to Show Picture in Image Control in Visual Basic 6?

E-mail Print PDF
This article shows you the Visual Basic 6 code on how to view picture in Image Control. Additionally, in this sample you will see how to use FileListBox Control, DirListBox Control and DriveListBox Control.
Private Sub Dir1_Change()
    File1.Path = Dir1.Path
End Sub

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

Private Sub File1_Click()
    Dim StrPic As String
    StrPic = File1.Path
    If Right(StrPic, 1) <> "\" Then StrPic = StrPic & "\"
    imgPic = LoadPicture(StrPic & File1.FileName)
End Sub

Download Source Code