I have put a background picture in a panel and now i want to drag and drop bitmap images on it.how do i accomplish that?

Recommended Answers

All 4 Replies

do you want set it as background for banel after dropping ??
from what you will drag image ?? picture box or outside programm ??

Please see this thread regarding to drag and drop:
http://www.daniweb.com/forums/thread208280.html

Here is another thread in C# if you can port the code:
http://www.daniweb.com/forums/thread207602.html

The VB code provided:

Public Class FormDragDrop

	Private Sub FormDragDrop_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
		Me.AllowDrop = True
	End Sub

	Private Sub FormDragDrop_DragEnter(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles MyBase.DragEnter
		If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
			e.Effect = DragDropEffects.Copy
		End If
	End Sub

	Private Sub FormDragDrop_DragDrop(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles MyBase.DragDrop
		Dim handle As String() = e.Data.GetData(DataFormats.FileDrop, False)
		If (handle.Length > 0) Then
			If (System.IO.File.Exists(handle(0))) Then
				Me.BackgroundImage = Bitmap.FromFile(handle(0))
			End If
		End If
	End Sub
End Class

You will want to modify the code above to veryify that Bitmap.FromFile() does not throw an exception if a non-image type resource is dragged on to your panel.

from another panel overlay with pictures.that what i'm trying to do .i have not found a way to do that overlaying also.plz help me if you can

set the overlay of picture by photoshop CS
than set it as background
if u want me to set your picture ,send it to me or put it here as attachment ..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.