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
johngbeckett
NA
2
0
Trying to drag+drop image form one app to another
Oct 20 2004 5:18 PM
I have two applications, each with a PictureBox. How do I drag and drop the picture as is from the PictureBox in one application to the PictureBox in the other application? I'm able to drag and drop text from one app to another, but have been unsuccessful with images. I've tried this (didn't work): In source... private void pictureBoxSource_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Left) { pictureBoxSource.DoDragDrop( pictureBox1.Image, DragDropEffects.Copy ); } } In target... private void pictureBoxTarget_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) { if ( e.Data.GetDataPresent( DataFormats.Bitmap ) ) { e.Effect = DragDropEffects.Copy; } else e.Effect = DragDropEffects.None; } private void pictureBoxTarget_DragOver(object sender, System.Windows.Forms.DragEventArgs e { e.Effect=DragDropEffects.Copy; } private void pictureBoxTarget_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { if ( (e.Data.GetDataPresent(DataFormats.Bitmap))) { this.pictureBoxTarget.Image = (Bitmap)(e.Data.GetData(DataFormats.Bitmap)); } }
Reply
Answers (
0
)
How do I list Multiple Drives in Treeview
Saving and Opening Bitmaps