change picture with button and text
and we are learn load picture
make change picture
apple to orange to haha
the steps are
1. open microsoft visual basic yours
2. create a form like this
3. criteria
Object | Property | Nilai |
Text1 | Name | Text1 |
Text | delete | |
Command1 | Name | cmdapple |
Caption | Apple | |
Command2 | Name | cmdorange |
Caption | ORANGE | |
Command2 | Name | cmdexit |
Caption | Exit | |
Image | Name | Image1 |
4. oops forgot, download the pictures here
5. This source code
Private Sub cmdApple_Click()
Image1.Picture = LoadPicture("D:\vb\gantigambar\apple.jpg")
Text1.Text = "apple"
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub cmdOrange_Click()
Image1.Picture = LoadPicture("D:\vb\gantigambar\orange.jpg")
Text1.Text = "orange"
End Sub
Private Sub Image1_Click()
Image1.Picture = LoadPicture("D:\vb\gantigambar\haha.jpg")
End Sub
Private Sub Text1_Change()
If Text1.Text = "apple" Then
Image1.Picture = LoadPicture("D:\vb\gantigambar\apple.jpg")
ElseIf Text1.Text = "orange" Then
Image1.Picture = LoadPicture("D:\vb\gantigambar\orange.jpg")
Else
Image1.Picture = LoadPicture("D:\vb\gantigambar\haha.jpg")
End If
End Sub
thank you for visiting my blog
3 comments:
i like this
entuk sko endi e nin...
aku garap dewe jul. eksperiment
~x( :))
Post a Comment
thank you for visiting my blog and comment here. I hope the commentary contains a comment which intend to build and repair. criticism and suggestions I gladly accept.