TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
deryk_2784
NA
27
0
help! i want a loop to continue while my mouse is over a picture box but stop when it leaves
Sep 1 2004 2:43 AM
hi everyone. right now, i have a map graphic displayed on my program's main screen. around it are four buttons. what i basically want to happen is, since the map is too big to show all at once, i want to use the four buttons to make the map scroll left or right. let's call the top button "UpMap". i currently have an action set for its mouseenter that goes something like: //UpMove, yMap, and xMap are all global variables UpMove = true; //to tell the program to keep the image moving upward while(UpMove) { yMap -= 1; //to set the image to a point 1 pixel higher than its previous location this.map_graphic.Location = new System.Drawing.Point(xMap, yMap); } for the mouseleave, i have something like: UpMove = false; i take it once the mouse enters the picture box area, UpMove is set to true and the loop starts and continues. supposedly, once the mouse leaves the area, it should set UpMove to false, thus stopping the loop. but what happens is that the loop continues infinitely, and the image moves up continuously and i can't even close the application window. any ways to fix this or any other suggestions on how to do it? :) thanks!
Reply
Answers (
3
)
SOS:PropertyGrid question
How to resize a listview when the scroll bars appear???