Hola a todos!! Para mover un shape, utilizo la magnífica librería dx_lib32 2.0, por cierto,muy buenalibrería, [EX3]
. Ahora va mi problema.
Tengo este código para Form_Load:
Este codigo para Form_Unload:Código:Private Sub Form_Load() Set m_Input = New dx_Input_Class 'Creamos la referencia a la clase dx_Input. Call m_Input.Init(Me.hWnd) 'Inicializamos la clase dx_Input. End Sub
Código:Private Sub Form_Unload(Cancel As Integer) 'Terminamos la ejecucion de la clase: Call m_Input.Terminate 'Destruimos la instancia de la clase: Set m_Input = Nothing End End Sub
Y por útltimo, en un Timer1, con la propiedadIntervala 10:
Código:Private Sub Timer1_Timer() With m_Input If .Key(Key_Left) Then Shape1.Left = Shape1.Left - 100 End If If .Key(Key_Right) Then Shape1.Left = Shape1.Left + 100 End If If .Key(Key_Up) Then Shape1.Top = Shape1.Top - 100 End If If .Key(Key_Down) Then Shape1.Top = Shape1.Top + 100 End If End With End Sub
Ahora, éste es mi problema, cuando muevo el shape (este codigo me funciona muy bien), no quiero que se salga por los bordes, alguien sabe como conseguir esto???
Muchas gracias de antemano.
Salu2...Edited by: K0rl3oN