performance - Slow load image from button Tool after event Mouse hover and leave in VB.net -
sorry english writing new vb.net. have button sets image background picture using mouse hover , mouse leave change image . problem seem slow when loading images after event. there way improve performance?
private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load button1.backgroundimage = my.resources._1 end sub private sub button1_mousehover(byval sender object, byval e system.eventargs) handles button1.mousehover button1.backgroundimage = my.resources._2 end sub private sub button1_mouseleave(byval sender object, byval e system.eventargs) handles button1.mouseleave button1.backgroundimage = my.resources._1 end sub
its not image slow load rather default time needs fire mousehover event here more info on mousehovertime seem can set system wide via api though.
a alternative use mouseenter instead of mousehover
private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load button1.backgroundimage = my.resources._1 end sub 'use mouseenter event instead private sub button1_mouseenter(sender object, e eventargs) handles button1.mouseenter button1.backgroundimage = my.resources._2 end sub private sub button1_mouseleave(byval sender object, byval e system.eventargs) handles button1.mouseleave button1.backgroundimage = my.resources._1 end sub
Comments
Post a Comment