-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: vivek_vellokkandi
Message 4 in Discussion
Hello Murthy, I have gone through you code. But I couldnt understand your drop
target of the picture box. i.e When you drag the picturebox from your frame
control. Anyway if your problem how to drag your picture control, here is the
solution. Add the following event handlers for your picturebox:
myPictureBox.MouseMove += new
System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove);
myPictureBox.MouseDown += new
System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseDown);
Create memeber of type PictureBox to identify which picture is currently
selected:
private System.Windows.Forms.PictureBox selectedPicture = null;
Now in the event handlers add the following code:
private void pictureBox1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
selectedPicture = (PictureBox)sender;
}
private void pictureBox1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if( selectedPicture == null )
return;
selectedPicture.DoDragDrop(selectedPicture.Image , DragDropEffects.Move |
DragDropEffects.None );
}
This will set the data of type System.Drawing.Bitmap
Now in the DragDrop event handler of your target add code to handle it :
if(e.Data.GetDataPresent(DataFormats.Bitmap) )
{
System.Drawing.Bitmap bmp = e.Data.GetData(typeof(System.Drawing.Bitmap));
}
Now you can make use of this Bitmap object.
Hope this will solve the problem. If you can tell me the actual drop target of
your picture I can give you the exact solution.
Regards
vivek
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]