Saturday, May 11, 2013

Image map clicks. Give a value to each click

I have an image map set up which divides an image into an integer of different values. Basically different scores. The user gets 3 clicks on the image and his score is totaled.


kvp only gives me the score of the previous click and i'm not sure how to just save the score of that click and move on to the 2nd.


It will look like:


label2.text = value of 1st click


label3.text = value of 2nd click


label4.text = value of 3rd click


label5.text = value of all 3 combined.




Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown

Dim kvp As KeyValuePair(Of Drawing2D.GraphicsPath, Integer) = sections.FirstOrDefault(Function(de) de.Key.IsVisible(e.Location))

thrown = thrown + 1

If thrown > 3 Then
thrown = thrown - 1
Exit Sub
End If

g = PictureBox1.CreateGraphics
DrawNewCircle(e.X, e.Y)
Label2.Text = kvp.Value

End Sub




No comments:

Post a Comment