ayesha120597
New member
- Joined
- Apr 12, 2021
- Messages
- 3
- Programming Experience
- 1-3
I want the user to select an image by clicking the button and then clicking select that will close the form. I have the images in a separate folder that I have added as a picturebox and they are added above their respected button. So what I am trying to do is create an if-else statement, where: if the user clicks a certain button (for example button1) it would assign a variable called cardbackimage to retain the image associated with button1.
I wanted to know
-how to assign an image to a button ( so when you click it, it means that the user wants that image)
-how to assign the image that was selected to a variable
- and how to end the form once the image is selected, I have made the select button (as shown in the image) the accept button
I wanted to know
-how to assign an image to a button ( so when you click it, it means that the user wants that image)
-how to assign the image that was selected to a variable
- and how to end the form once the image is selected, I have made the select button (as shown in the image) the accept button
Form code:
Public Class Form1
Private Sub VScrollBar1_Scroll(sender As Object, e As ScrollEventArgs)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub CancelBtn_Click(sender As Object, e As EventArgs) Handles CancelBtn.Click
End Sub
Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
End Sub
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
End Sub
Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
End Sub
Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
End Sub
Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
End Sub
End Class
Last edited: