-
Expert
86 Answers
- Posted on Jan 05, 2010
Re: Program code that can light a bulb using vb
You can do it a couple of ways, but this would probably be the shortest. Realize this depends on what forms you're qualifying for the pictures.
-
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
-
'
-
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
-
-
End Sub
-
-
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
-
'
-
PictureBox1.Image = Image.FromFile("C:\BulbOn.jpg")
-
-
End Sub
-
-
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
-
'
-
PictureBox1.Image = Image.FromFile("C:\BulbOff.jpg")
-
-
End Sub
×