Muy buenas a todos!
sr.
ss_jesus, aqui le traigo un ejemplo que quizas le pueda servir de utilidad, el mismo le dice las coordenadas en donde ha dado un click con su mouse, util para asi guardar esos puntos en su base de datos, o atrar algun evento, ya sea cambiando su mapa de bits, por uno nuevo, a partir de estos datos.
Aplique este ejemplo para ver, y me dice si le sirvio:
- Agregue un Picture Box a tu form1 y agregue este codigo:
Código:
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Const Ancho = 0.3
Const Alto = 0.3
Dim CoordX As Single, CoorY As Single
Dim X1 As Single, Y1 As Single, W1 As Single, H1 As Single
Dim file As Integer, col As Integer
If Button = vbLeftButton Then
CoordX = X - ((Picture1.ScaleWidth * Ancho) / 2)
If CoordX < 0 Then CoordX = 0
If (CoordX + (Ancho * Picture1.ScaleWidth)) > Picture1.ScaleWidth Then
CoordX = Picture1.ScaleWidth * (1 - Ancho)
End If
CoordY = Y - ((Picture1.ScaleHeight * Alto) / 2)
If CoordY < 0 Then CoordY = 0
If (CoordY + (Alto * Picture1.ScaleHeight) > Picture1.ScaleHeight) Then
CoordY = Picture1.ScaleHeight * (1 - Alto)
End If
MsgBox CoordX & "-" & CoordY
End If
End Sub Esto le traera un Mensaje que dice la posicion donde dio click, sobre el Picture1.
Espero que les sea de utilidad.
Un saludo a todos! :smt006