المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : how to use ctrl+v for pasting a image in the rich text box



C# Programming
04-12-2009, 12:31 AM
I can insert image from file ******** but can't pasting it through ctrl+v.
Its showing a box saying "JPEG Image" but didn't show the actual image.

here is my code...



if (e.Modifiers == Keys.Control && e.KeyCode == Keys.V)
{

DataFormats.Format df;
df = DataFormats.GetFormat(DataFormats.Bitmap);

if (Clipboard.ContainsImage())
{
Clipboard.SetDataObject(img);
rtbDoc.Paste(df);
e.Handled = true;
Clipboard.Clear();
}
//SendMessage(rtbDoc.Handle, WM_PASTE, 0, 0);
//e.Handled = true;

}