Need Urgent Help Feeding A Picture Into code
Ok, so here is my problem. I am making an email flyer for a barbeque. I need to know if people want hot dogs, burger, cheese, etc... I have made a form with check boxes next to each food item. What I want to do is :
When the person clicks the check box, a picture of the food item pops up.
If anyone knows a code or a way to compile a code to do this it would be greatly appreciated.
Re: Need Urgent Help Feeding A Picture Into code
Load pics of the food into picture boxes (make Visible = False when the form loads) next to the options then when a user ticks a certain food show the picture box then if they untick it hide the picture box. HTH :wave:
Re: Need Urgent Help Feeding A Picture Into code
Ok, I need to clear some things up. I have made 4 picture boxes now. Now, what is the code to have the picture show up when I click it and when I unclick it. Also, where is it exactly that I insert the picture. I clicked the lightning bolt because I know those are extra settings, but is that the right place? Or is it somewhere different and could you please tell me how to insert it to the Picturebox and then the code to use it in show/hide format.
Thanks a very very much.
Re: Need Urgent Help Feeding A Picture Into code
VB Code:
'chkPizza is the name of your check box
'picPizza is the name of your picture box
If chkPizza.Value = 1 Then
picPizza.Visible = True
ElseIf chkPizza.Value = 0 Then
picPizza.Visible = False
End if
Re: Need Urgent Help Feeding A Picture Into code
Awesome thanks alot man. I really do appreciate it. You guys are not stuck up here on helping noobs like on some other sites.
BUT: The code above I know is for the visibility and that stuff. But where is it that I insert the picture for the Picture Box?
Re: Need Urgent Help Feeding A Picture Into code
Re: Need Urgent Help Feeding A Picture Into code
[Public Class Form1
Private Sub chkHotDog_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkHotDog.CheckedChanged
If chkHotDog.Visible = 1 Then
picHotDog.Visible = True
ElseIf chkHotDog.Visible = 0 Then
picHotDog.Visible = False
End If
End Sub
Private Sub picHotDog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picHotDog.Click
If chkHotDog.Visible = 1 Then
picHotDog.Visible = True
ElseIf chkHotDog.Visible = 0 Then
picHotDog.Visible = False
End If
End Sub
End Class]
This is my code, but I can't seem to get it to work. My picture box is right next to the corresponding check box, and the Asychronus Initial Image has the picture of the food item I want. What is wrong here?
1 Attachment(s)
Re: Need Urgent Help Feeding A Picture Into code
Check out the attached as it should get you going.
Re: Need Urgent Help Feeding A Picture Into code
So the above attached link, how am I exactly supposed to use it. The Word document set the different heights, widths, etc.. but I am unsure of where to start because there is a lot of different settings to set. So, should I make the form and add those settings? And where do I put the :
If chkHotDog.Visible = 1 Then
picHotDog.Visible = True
ElseIf chkHotDog.Visible = 0 Then
picHotDog.Visible = False
End If
Re: Need Urgent Help Feeding A Picture Into code
Moved to Classic VB forum seeing how the code examples are posted in VB 6 and seem to be what the thread poster wants. ;)
Re: Need Urgent Help Feeding A Picture Into code
Did you run my example?
Did you click the check boxes 1 by 1 to see the corrisponding picture box appear?
Re: Need Urgent Help Feeding A Picture Into code
EDIT: Ok, it works. I will edit it to make the pics I want. Thank you so much. This taught me alot thnx.
1 Attachment(s)
Re: Need Urgent Help Feeding A Picture Into code
There is no .DOC file in the zip file??