Asked • 04/23/19

Change output of textbox based on button clicked Visual Basic?

Hi everyone I am new to visual basic and am making my first program from a book I just bought and would like to change the output of my textbox based on the button I click for example if button1 is clicked I would like it to say "You selected cheese.". Here is my code. Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click PictureBox1.Image = My.Resources.cheese End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click PictureBox1.Image = My.Resources.cookie End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click PictureBox1.Image = My.Resources.pretzel End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click PictureBox1.Image = My.Resources.peanut End Sub Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click End Sub Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.