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
LEUNG TING YU
NA
2
0
move a icon(bitmap) in a certain range
Aug 13 2010 3:16 AM
I have a icon picsmall . It should move in y axis in a certain range . I wrote a code but when it move upwards in a predefine value it never move again when I move the icon downwards , what should I do ?? here is the code :
private void picSmall_MouseDown(object sender, MouseEventArgs e)
{
drag = true;
y_down = e.Y;
picsmall.Image = imageList1.Images[0];
}
private void picSmall_MouseMove(object sender, MouseEventArgs e)
{
int co;
if (drag)
{
if (picsmall.Top> 30) //30 is the max value
{
co = picsmall.Top;
picsmall.Top += (e.Y - y_down);
}
else if (picsmall.Top == 30)
{
co = 30;
co += (e.Y - y_down);
}
}
private void picSmall_MouseUp(object sender, MouseEventArgs e)
{
drag = false;
}
Reply
Answers (
0
)
Forms
System.UnauthorizedAccessException