Holap, gracias `por tenerme paciencia..... copie tu codigo en un nuevo proyecto pero este leia aparte de la imagen q le daba click tambien la de alado..... sabes me puse ha estar moniando ..y solo tenia este error q no van los iguales en la codificación del detector de imagenes q me diste.....jajja lo logramos......muchas gracias he.....Realmente sos lo maximo!!!
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
For Each k As PictureBox In pb
If e.X >
= k.Left And e.X <
= k.Left + k.Width Then
If e.X >
= k.Top And e.Y <
= k.Top + k.Height Then
MsgBox(k.Tag)
End If
End If
Next
End Sub
End Class
Oye una pregunta mmm...queria ajustarle el codigo para q funcionara mediante matrices; la matrices es cuadratica....pero no sé cual es el error....mmmmm...toma como limite para leer las imagenes de arriba de diagonal principal y las lee de corrido..osea le doy click a la imagen de la ultima columna y las lee de corrido.... por fis hechale le un vistazo...para q me digas cual es el error..aki te dejo el codigo q he hecho...gracias de antemano....espero no cansarte...
Public Class Form1
Private PB As New List(Of PictureBox)
Dim m(100, 100) As Integer
Dim rnd As New Random
Private Sub ING_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ING.Click
Dim i, j, b, k, c, f, y, t, x As Integer
Dim pict As PictureBox
b = Val(lim.Text)
If b Mod 2 <> 0 Then
MsgBox(" INGRESAR NUMERO PAR")
lim.Text = " "
lim.Focus()
End If
If b <= 10 Then
D1.ColumnCount = b
D1.RowCount = b
For f = 0 To b - 1
For c = 0 To b - 1
m(f, c) = 0
D1.Columns.Item(c).Width = 25
Next
Next
If b Mod 2 = 0 Then
t = (b * b) / 2
End If
y = 15
k = 40
For f = 0 To b - 1
For c = 0 To b - 1
Randomize()
x = rnd.Next(1, (t + 1))
m(f, c) = x
Next
Next
y = 10
k = 15
For i = 0 To b - 1
For j = 0 To b - 1
D1.Item(j, i).Value = m(i, j)
x = Val(m(i, j))
pict = New PictureBox
pict.Image = System.Drawing.Image.FromFile("f:3image" + Trim(Str(x)) + ".jpg")
pict.Name = "PIC_IMAGE" & CStr(x)
pict.Width = 35
pict.Height = 35
pict.SizeMode = PictureBoxSizeMode.StretchImage
pict.Left = y
pict.Top = k
y += 50
pict.Tag = x
pict.Enabled = False
Me.Controls.Add(pict)
PB.Add(pict)
pict = Nothing
Next
y = 15
k += 50
Next
Else
MsgBox("NUMEROS MENOR A 10")
lim.Text = " "
lim.Focus()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
End
End Sub
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
For Each s As PictureBox In PB
If e.X > s.Left And e.X <= s.Left + s.Width Then
If e.X > s.Top And e.Y < s.Top + s.Height Then
MsgBox(s.Tag)
End If
End If
Next
End Sub
End Class