VB.Net Move an object[Error] -


i start create project this(to topic)
error start in here(maybe)
first button code

private sub deimosbutton2_click(byval sender system.object, byval e system.eventargs) handles deimosbutton2.click         state(i)         deimosbutton3.visible = false         deimosbutton4.visible = false     end sub     private sub timer4_tick(byval sender system.object, byval e system.eventargs) handles timer4.tick         deimosbutton2.top = deimosbutton2.top - 1         if deimosbutton2.location = new point(22, 54)             timer4.stop()             deimosbutton2.enabled = true         end if     end sub     private sub state(byval ref integer)         if ref = 0             timer4.start()             deimosbutton2.enabled = false             = 1         else             timer5.start()             deimosbutton2.enabled = false             = 0         end if     end sub     private sub timer5_tick(byval sender system.object, byval e system.eventargs) handles timer5.tick         deimosbutton2.top = deimosbutton2.top + 1         if deimosbutton2.location = new point(22, 85)             timer5.stop()             deimosbutton2.enabled = true             deimosbutton3.visible = true             deimosbutton4.visible = true         end if     end sub 

this second button code

private sub deimosbutton3_click(byval sender system.object, byval e system.eventargs) handles deimosbutton3.click     states(o)     deimosbutton2.visible = false     deimosbutton4.visible = false end sub private sub timer6_tick(byval sender system.object, byval e system.eventargs) handles timer6.tick     deimosbutton3.top = deimosbutton3.top - 1     if deimosbutton3.location = new point(22, 54)         timer6.stop()         deimosbutton3.enabled = true     end if end sub private sub states(byval def integer)     if def = 0         timer6.start()         deimosbutton3.enabled = false         o = 1     else         timer7.start()         deimosbutton3.enabled = false         o = 0     end if end sub private sub timer7_tick(byval sender system.object, byval e system.eventargs) handles timer7.tick     deimosbutton3.top = deimosbutton3.top + 1     if deimosbutton3.location = new point(22, 116)         timer7.stop()         deimosbutton3.enabled = true         deimosbutton2.visible = true         deimosbutton4.visible = true     end if end sub 

the problem when click second button
when click first button, no matter.
problem : button still moving top, although has reach position.
there solution ?

you must change

deimosbutton3.location = new point(22, 116) 

to

deimosbutton3.location.y = 116 

this valid all
code


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -