Thursday, April 7, 2011

make the application change images using visual basic

| Thursday, April 7, 2011 | 3 comments

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:

eca-ace said...

i like this

Dwi Juli Prabowo said...

entuk sko endi e nin...

nino said...

aku garap dewe jul. eksperiment
~x( :))

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L 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.

Popular Posts

 

Total Pageviews

stat

© Copyright 2010. http://programminghaha.blogspot.com . All rights reserved | http://programminghaha.blogspot.com is proudly powered by Blogger.com | Template by o-om.com - zoomtemplate.com