i'm using the VB6 and i'm creating a control for put the Move and NotMove events, but i know that theres a error in my code... can anyone help me?
heres the control code:
i tested the currentx and currenty but i'm recive 0(zero), why?Code:Option Explicit Event Move(PosX As Long, PosY As Long) Event NotMove(PosX As Long, PosY As Long) Dim OldPosX As Long Dim OldPosY As Long Private Sub Timer1_Timer() 'testing if the usercontrol is moving or not If UserControl.CurrentX <> OldPosX Or UserControl.CurrentY <> OldPosY Then OldPosX = UserControl.CurrentX OldPosY = UserControl.CurrentY RaiseEvent Move(OldPosX, OldPosY) Else RaiseEvent NotMove(OldPosX, OldPosY) End If End Sub Private Sub UserControl_Initialize() 'receving the actual position of the usercontrol in form OldPosX = UserControl.CurrentX OldPosY = UserControl.CurrentY UserControl.MaskColor = UserControl.BackColor UserControl.MaskPicture = UserControl.Image End Sub
thanks





Reply With Quote