English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In Microsoft Visual Basic how do I include an image that then can be changed like with a list of images?
Please give code or relevant link.

2007-01-10 06:14:12 · 2 answers · asked by sbraidley 3 in Computers & Internet Programming & Design

2 answers

easy you can do it with the picture object.
Add a picture to your Form, a textbox and a command button

copy and paste into your form and you have a working example.

Private Sub Command1_Click()
'validate that it has some entry
If Len(Trim(Text1.Text)) > 0 Then
'check if the file exists
If Dir(Text1.Text, vbArchive) <> "" Then
Picture1.Picture = LoadPicture(Text1.Text)
End If
End If
End Sub


Regards,
Oscar

2007-01-13 08:05:55 · answer #1 · answered by Kool_Joss 2 · 0 0

Are you trying to get random images, or images that change by whatever the program is doing at the time? If the latter, then all you need to do is change the values of the picture object in each different dialogue.

2007-01-10 06:18:09 · answer #2 · answered by ? 3 · 0 0

fedest.com, questions and answers