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
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Image swapping in Panel
Nandakumar Selvaraj
Mar 27
2015
Code
907
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
SwappingImagesUsingD
private
void
panel_MouseDown(
object
sender, MouseEventArgs e)
{
Panel source = (Panel) sender;
DoDragDrop(source.BackgroundImage, DragDropEffects.Copy);
source.BackgroundImage = b;
}
private
void
panel_DragEnter(
object
sender, DragEventArgs e)
{
if
(e.Data.GetDataPresent(
typeof
(Bitmap)))
{
p = (Panel) sender;
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.None;
}
}
private
void
panel_DragDrop(
object
sender, DragEventArgs e)
{
Panel destination = (Panel) sender;
b = (Bitmap) destination.BackgroundImage;
destination.BackgroundImage = (Bitmap) e.Data.GetData(
typeof
(Bitmap));
}
DragDrop
Image Swapping
Image Panel