 
			
				30/06/2007, 11:42
			
			
			     |  
      |    |    |    Fecha de Ingreso: marzo-2006  
						Mensajes: 202
					  Antigüedad: 19 años, 6 meses Puntos: 2     |        |  
  |      Re: recuperar la posicion        La solucion a esto para quien no la sepa era tan sencillo como que al momento de crear mi matriz asignar en mi caso la propiedad tag de mi boton y este valor asignarle los indices que corresponden pero na mas chachara y veanlo por ustedes mismos:   
Private Sub GeneraLC(ByVal ta As Integer, ByVal baño As String) 
        Dim i, j, x, y As Integer 
        Dim posx, posy As Integer 
        Dim espacio As Integer = 55 '//espacio entre los botones en las filas 
        Dim alto As Integer = 30 '// espacio enter los botones en las columnas 
        If (ta = 42) Or (ta = 46) And (baño = "central") Then 
            lc = Math.Round(((ta / 2) + 3) / 2) 
        Else 
            lc = ((ta / 2) + 2) / 2 
        End If 
        For i = 3 To 4 
            For j = 1 To lc 
                'inicializacion de la matriz 
                buses(i, j) = New Button   x = i 
                y = j 
                posx = j * espacio 
                posy = i * alto + 30 
                buses(i, j).Location = New System.Drawing.Point(posx, posy) 
                buses(i, j).Size = New System.Drawing.Size(42, 27) 
                buses(i, j).Image = Global.WindowsApplication1.My.Resources.Resources.  Poltrona  buses(i, j).Tag = x & "," & y 
                Me.Controls.Add(buses(i, j)) 
                AddHandler buses(i, j).Click, AddressOf Evento_Click 
            Next j 
        Next i 
    End Sub   
des pues se rescata asi: 
Private Sub Evento_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
        'Aqui esta el evento 
        Dim ind As String 
        MsgBox(sender.text)   MsgBox(sender.tag) 
End Sub           |