<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FDrag_Drop</id>
		<title>Csharp/C Sharp/GUI Windows Form/Drag Drop - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FGUI_Windows_Form%2FDrag_Drop"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Drag_Drop&amp;action=history"/>
		<updated>2026-04-30T00:12:37Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Drag_Drop&amp;diff=148&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Drag_Drop&amp;diff=148&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:18Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Drag_Drop&amp;diff=149&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/GUI_Windows_Form/Drag_Drop&amp;diff=149&amp;oldid=prev"/>
				<updated>2010-05-26T11:33:33Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Drag and drop image to another window==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class Palette : Form&lt;br /&gt;
{&lt;br /&gt;
  private System.Windows.Forms.Label lblPictureThree;&lt;br /&gt;
  private System.Windows.Forms.Label lblPictureTwo;&lt;br /&gt;
  private System.Windows.Forms.Label lblPictureOne;&lt;br /&gt;
  public Palette() {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
  }&lt;br /&gt;
  private void lbl_MouseDown(object sender, MouseEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    Label lbl = (Label)sender;&lt;br /&gt;
    lbl.DoDragDrop(lbl.Image, DragDropEffects.Copy);&lt;br /&gt;
  }&lt;br /&gt;
  private void InitializeComponent()&lt;br /&gt;
  {&lt;br /&gt;
    this.lblPictureThree = new System.Windows.Forms.Label();&lt;br /&gt;
    this.lblPictureTwo = new System.Windows.Forms.Label();&lt;br /&gt;
    this.lblPictureOne = new System.Windows.Forms.Label();&lt;br /&gt;
    this.SuspendLayout();&lt;br /&gt;
    // &lt;br /&gt;
    // lblPictureThree&lt;br /&gt;
    // &lt;br /&gt;
    this.lblPictureThree.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;&lt;br /&gt;
    this.lblPictureThree.Image = new Bitmap(&amp;quot;winter.jpg&amp;quot;);&lt;br /&gt;
    this.lblPictureThree.Location = new System.Drawing.Point(12, 113);&lt;br /&gt;
    this.lblPictureThree.Name = &amp;quot;lblPictureThree&amp;quot;;&lt;br /&gt;
    this.lblPictureThree.Size = new System.Drawing.Size(56, 48);&lt;br /&gt;
    this.lblPictureThree.TabIndex = 6;&lt;br /&gt;
    this.lblPictureThree.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbl_MouseDown);&lt;br /&gt;
    // &lt;br /&gt;
    // lblPictureTwo&lt;br /&gt;
    // &lt;br /&gt;
    this.lblPictureTwo.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;&lt;br /&gt;
    this.lblPictureTwo.Image = new Bitmap(&amp;quot;winter.jpg&amp;quot;);&lt;br /&gt;
    this.lblPictureTwo.Location = new System.Drawing.Point(12, 61);&lt;br /&gt;
    this.lblPictureTwo.Name = &amp;quot;lblPictureTwo&amp;quot;;&lt;br /&gt;
    this.lblPictureTwo.Size = new System.Drawing.Size(56, 48);&lt;br /&gt;
    this.lblPictureTwo.TabIndex = 5;&lt;br /&gt;
    this.lblPictureTwo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbl_MouseDown);&lt;br /&gt;
    // &lt;br /&gt;
    // lblPictureOne&lt;br /&gt;
    // &lt;br /&gt;
    this.lblPictureOne.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;&lt;br /&gt;
    this.lblPictureOne.Image = new Bitmap(&amp;quot;winter.jpg&amp;quot;);&lt;br /&gt;
    this.lblPictureOne.Location = new System.Drawing.Point(12, 9);&lt;br /&gt;
    this.lblPictureOne.Name = &amp;quot;lblPictureOne&amp;quot;;&lt;br /&gt;
    this.lblPictureOne.Size = new System.Drawing.Size(56, 48);&lt;br /&gt;
    this.lblPictureOne.TabIndex = 4;&lt;br /&gt;
    this.lblPictureOne.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbl_MouseDown);&lt;br /&gt;
    // &lt;br /&gt;
    // Palette&lt;br /&gt;
    // &lt;br /&gt;
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);&lt;br /&gt;
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(83, 173);&lt;br /&gt;
    this.Controls.Add(this.lblPictureTwo);&lt;br /&gt;
    this.Controls.Add(this.lblPictureOne);&lt;br /&gt;
    this.Controls.Add(this.lblPictureThree);&lt;br /&gt;
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;&lt;br /&gt;
    this.Name = &amp;quot;Palette&amp;quot;;&lt;br /&gt;
    this.ShowInTaskbar = false;&lt;br /&gt;
    this.Text = &amp;quot;Palette&amp;quot;;&lt;br /&gt;
    this.ResumeLayout(false);&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main()&lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new DrawingArea());&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
  public class DrawingArea : Form&lt;br /&gt;
  {&lt;br /&gt;
    private System.Windows.Forms.PictureBox picDrawingArea;&lt;br /&gt;
    public DrawingArea()&lt;br /&gt;
    {&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
    }&lt;br /&gt;
    private void DrawingArea_Load(object sender, EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      Palette frmTool = new Palette();&lt;br /&gt;
      this.AddOwnedForm(frmTool);&lt;br /&gt;
      frmTool.Show();&lt;br /&gt;
      picDrawingArea.AllowDrop = true;&lt;br /&gt;
    }&lt;br /&gt;
    private void picDrawingArea_DragEnter(object sender, DragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      if (e.Data.GetDataPresent(DataFormats.Bitmap))&lt;br /&gt;
      {&lt;br /&gt;
        e.Effect = DragDropEffects.Copy;&lt;br /&gt;
      }&lt;br /&gt;
      else&lt;br /&gt;
      {&lt;br /&gt;
        e.Effect = DragDropEffects.None;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    private void picDrawingArea_DragDrop(object sender, DragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      Graphics g = picDrawingArea.CreateGraphics();&lt;br /&gt;
      g.DrawImage((Image)e.Data.GetData(DataFormats.Bitmap),&lt;br /&gt;
        new Point(e.X - this.Left, e.Y - this.Top));&lt;br /&gt;
    }&lt;br /&gt;
     private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.picDrawingArea = new System.Windows.Forms.PictureBox();&lt;br /&gt;
      ((System.ruponentModel.ISupportInitialize)(this.picDrawingArea)).BeginInit();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // picDrawingArea&lt;br /&gt;
      // &lt;br /&gt;
      this.picDrawingArea.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)&lt;br /&gt;
            | System.Windows.Forms.AnchorStyles.Left)&lt;br /&gt;
            | System.Windows.Forms.AnchorStyles.Right)));&lt;br /&gt;
      this.picDrawingArea.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;&lt;br /&gt;
      this.picDrawingArea.Location = new System.Drawing.Point(1, 2);&lt;br /&gt;
      this.picDrawingArea.Name = &amp;quot;picDrawingArea&amp;quot;;&lt;br /&gt;
      this.picDrawingArea.Size = new System.Drawing.Size(377, 270);&lt;br /&gt;
      this.picDrawingArea.TabIndex = 2;&lt;br /&gt;
      this.picDrawingArea.TabStop = false;&lt;br /&gt;
      this.picDrawingArea.DragDrop += new System.Windows.Forms.DragEventHandler(this.picDrawingArea_DragDrop);&lt;br /&gt;
      this.picDrawingArea.DragEnter += new System.Windows.Forms.DragEventHandler(this.picDrawingArea_DragEnter);&lt;br /&gt;
      // &lt;br /&gt;
      // DrawingArea&lt;br /&gt;
      // &lt;br /&gt;
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);&lt;br /&gt;
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(379, 274);&lt;br /&gt;
      this.Controls.Add(this.picDrawingArea);&lt;br /&gt;
      this.Name = &amp;quot;DrawingArea&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;Drawing Area&amp;quot;;&lt;br /&gt;
      this.Load += new System.EventHandler(this.DrawingArea_Load);&lt;br /&gt;
      ((System.ruponentModel.ISupportInitialize)(this.picDrawingArea)).EndInit();&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Drag and drop inside a container==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
public class Form1 : System.Windows.Forms.Form&lt;br /&gt;
{&lt;br /&gt;
  internal System.Windows.Forms.Label lblDragger;&lt;br /&gt;
  public Form1()&lt;br /&gt;
  {&lt;br /&gt;
    InitializeComponent();&lt;br /&gt;
  }&lt;br /&gt;
  private void InitializeComponent()&lt;br /&gt;
  {&lt;br /&gt;
    this.lblDragger = new System.Windows.Forms.Label();&lt;br /&gt;
    this.SuspendLayout();&lt;br /&gt;
    // &lt;br /&gt;
    // lblDragger&lt;br /&gt;
    // &lt;br /&gt;
    this.lblDragger.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;&lt;br /&gt;
    this.lblDragger.Image = new Bitmap(&amp;quot;winter.jpg&amp;quot;);&lt;br /&gt;
    this.lblDragger.Location = new System.Drawing.Point(110, 105);&lt;br /&gt;
    this.lblDragger.Name = &amp;quot;lblDragger&amp;quot;;&lt;br /&gt;
    this.lblDragger.Size = new System.Drawing.Size(72, 56);&lt;br /&gt;
    this.lblDragger.TabIndex = 2;&lt;br /&gt;
    this.lblDragger.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lblDragger_MouseUp);&lt;br /&gt;
    this.lblDragger.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lblDragger_MouseMove);&lt;br /&gt;
    this.lblDragger.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lblDragger_MouseDown);&lt;br /&gt;
    // &lt;br /&gt;
    // Form1&lt;br /&gt;
    // &lt;br /&gt;
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
    this.ClientSize = new System.Drawing.Size(292, 266);&lt;br /&gt;
    this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                    this.lblDragger});&lt;br /&gt;
    this.Name = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
    this.Text = &amp;quot;Fake Drag And Drop&amp;quot;;&lt;br /&gt;
    this.ResumeLayout(false);&lt;br /&gt;
  }&lt;br /&gt;
  [STAThread]&lt;br /&gt;
  static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    Application.Run(new Form1());&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  private bool isDragging = false;&lt;br /&gt;
&lt;br /&gt;
  private int clickOffsetX, clickOffsetY;&lt;br /&gt;
&lt;br /&gt;
  private void lblDragger_MouseDown(System.Object sender, System.Windows.Forms.MouseEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    isDragging = true;&lt;br /&gt;
    clickOffsetX = e.X;&lt;br /&gt;
    clickOffsetY = e.Y;&lt;br /&gt;
  }&lt;br /&gt;
  private void lblDragger_MouseUp(System.Object sender, System.Windows.Forms.MouseEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    isDragging = false;&lt;br /&gt;
  }&lt;br /&gt;
  private void lblDragger_MouseMove(System.Object sender,&lt;br /&gt;
    System.Windows.Forms.MouseEventArgs e)&lt;br /&gt;
  {&lt;br /&gt;
    if (isDragging == true)&lt;br /&gt;
    {&lt;br /&gt;
      lblDragger.Left = e.X + lblDragger.Left - clickOffsetX;&lt;br /&gt;
      lblDragger.Top = e.Y + lblDragger.Top - clickOffsetY;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Drag and drop the PictureBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
  using System;&lt;br /&gt;
  using System.Drawing;&lt;br /&gt;
  using System.Collections;&lt;br /&gt;
  using System.ruponentModel;&lt;br /&gt;
  using System.Windows.Forms;&lt;br /&gt;
  using System.Data;&lt;br /&gt;
  public class Form1 : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    private bool  isDragging = false;&lt;br /&gt;
    private int   currentX, currentY;&lt;br /&gt;
    Rectangle dropRect = new Rectangle(180, 180, 60, 60);&lt;br /&gt;
    private PictureBox myPictureBox; &lt;br /&gt;
    public Form1()&lt;br /&gt;
    {&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
      CenterToScreen();&lt;br /&gt;
      myPictureBox = new PictureBox();&lt;br /&gt;
      myPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;&lt;br /&gt;
      myPictureBox.Location = new System.Drawing.Point(64, 32);&lt;br /&gt;
      myPictureBox.Size = new System.Drawing.Size(50, 50);&lt;br /&gt;
      myPictureBox.Image = new Bitmap(&amp;quot;winter.jpg&amp;quot;);&lt;br /&gt;
      myPictureBox.MouseDown += new MouseEventHandler(myPictureBox_MouseDown);&lt;br /&gt;
      myPictureBox.MouseUp += new MouseEventHandler(myPictureBox_MouseUp);&lt;br /&gt;
      myPictureBox.MouseMove += new MouseEventHandler(myPictureBox_MouseMove);&lt;br /&gt;
      myPictureBox.Cursor = Cursors.Hand;&lt;br /&gt;
      Controls.Add(myPictureBox);&lt;br /&gt;
    }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(292, 273);&lt;br /&gt;
      this.Text = &amp;quot;Dragging Images&amp;quot;;&lt;br /&gt;
      this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);&lt;br /&gt;
    }&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new Form1());&lt;br /&gt;
    }&lt;br /&gt;
    private void myPictureBox_MouseDown(object sender, MouseEventArgs e) &lt;br /&gt;
    {&lt;br /&gt;
      isDragging = true;&lt;br /&gt;
      currentX = e.X;&lt;br /&gt;
      currentY = e.Y;&lt;br /&gt;
    }&lt;br /&gt;
    private void myPictureBox_MouseMove(object sender, MouseEventArgs e) {&lt;br /&gt;
      if (isDragging) {&lt;br /&gt;
        myPictureBox.Top = myPictureBox.Top + (e.Y - currentY);&lt;br /&gt;
        myPictureBox.Left = myPictureBox.Left + (e.X - currentX);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    private void myPictureBox_MouseUp(object sender, MouseEventArgs e) &lt;br /&gt;
    {&lt;br /&gt;
      isDragging = false;&lt;br /&gt;
      Console.WriteLine(dropRect.Contains(myPictureBox.Bounds));&lt;br /&gt;
    }&lt;br /&gt;
    private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      Graphics g = e.Graphics;&lt;br /&gt;
      g.FillRectangle(Brushes.AntiqueWhite, dropRect);&lt;br /&gt;
      g.DrawString(&amp;quot;Drag and drop the image here.&amp;quot;, new Font(&amp;quot;Times New Roman&amp;quot;, 8), Brushes.Red, dropRect);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Fake Drag And Drop==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
User Interfaces in C#: Windows Forms and Custom Controls&lt;br /&gt;
by Matthew MacDonald&lt;br /&gt;
Publisher: Apress&lt;br /&gt;
ISBN: 1590590457&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Data;&lt;br /&gt;
namespace FakeDragAndDrop&lt;br /&gt;
{&lt;br /&gt;
  /// &amp;lt;summary&amp;gt;&lt;br /&gt;
  /// Summary description for FakeDragAndDrop.&lt;br /&gt;
  /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
  public class FakeDragAndDrop : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    internal System.Windows.Forms.Label lblDragger;&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Required designer variable.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private System.ruponentModel.Container components = null;&lt;br /&gt;
    public FakeDragAndDrop()&lt;br /&gt;
    {&lt;br /&gt;
      //&lt;br /&gt;
      // Required for Windows Form Designer support&lt;br /&gt;
      //&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
      //&lt;br /&gt;
      // TODO: Add any constructor code after InitializeComponent call&lt;br /&gt;
      //&lt;br /&gt;
    }&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Clean up any resources being used.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    protected override void Dispose( bool disposing )&lt;br /&gt;
    {&lt;br /&gt;
      if( disposing )&lt;br /&gt;
      {&lt;br /&gt;
        if (components != null) &lt;br /&gt;
        {&lt;br /&gt;
          components.Dispose();&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      base.Dispose( disposing );&lt;br /&gt;
    }&lt;br /&gt;
    #region Windows Form Designer generated code&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// Required method for Designer support - do not modify&lt;br /&gt;
    /// the contents of this method with the code editor.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FakeDragAndDrop));&lt;br /&gt;
      this.lblDragger = new System.Windows.Forms.Label();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // lblDragger&lt;br /&gt;
      // &lt;br /&gt;
      this.lblDragger.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;&lt;br /&gt;
      this.lblDragger.Image = ((System.Drawing.Bitmap)(resources.GetObject(&amp;quot;lblDragger.Image&amp;quot;)));&lt;br /&gt;
      this.lblDragger.Location = new System.Drawing.Point(110, 105);&lt;br /&gt;
      this.lblDragger.Name = &amp;quot;lblDragger&amp;quot;;&lt;br /&gt;
      this.lblDragger.Size = new System.Drawing.Size(72, 56);&lt;br /&gt;
      this.lblDragger.TabIndex = 2;&lt;br /&gt;
      this.lblDragger.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lblDragger_MouseUp);&lt;br /&gt;
      this.lblDragger.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lblDragger_MouseMove);&lt;br /&gt;
      this.lblDragger.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lblDragger_MouseDown);&lt;br /&gt;
      // &lt;br /&gt;
      // FakeDragAndDrop&lt;br /&gt;
      // &lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(292, 266);&lt;br /&gt;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                      this.lblDragger});&lt;br /&gt;
      this.Name = &amp;quot;FakeDragAndDrop&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;Fake Drag And Drop&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    #endregion&lt;br /&gt;
    /// &amp;lt;summary&amp;gt;&lt;br /&gt;
    /// The main entry point for the application.&lt;br /&gt;
    /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new FakeDragAndDrop());&lt;br /&gt;
    }&lt;br /&gt;
    // Keep track of when fake &amp;quot;drag and drop&amp;quot; mode is enabled.&lt;br /&gt;
    private bool isDragging = false;&lt;br /&gt;
    // Store the location where the user clicked the control.&lt;br /&gt;
    private int clickOffsetX, clickOffsetY;&lt;br /&gt;
    // Start dragging.&lt;br /&gt;
    private void lblDragger_MouseDown(System.Object sender,&lt;br /&gt;
      System.Windows.Forms.MouseEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      isDragging = true;&lt;br /&gt;
      clickOffsetX = e.X;&lt;br /&gt;
      clickOffsetY = e.Y;&lt;br /&gt;
    }&lt;br /&gt;
    // End dragging.&lt;br /&gt;
    private void lblDragger_MouseUp(System.Object sender,&lt;br /&gt;
      System.Windows.Forms.MouseEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      isDragging = false;&lt;br /&gt;
    }&lt;br /&gt;
    // Move the control (during dragging).&lt;br /&gt;
    private void lblDragger_MouseMove(System.Object sender,&lt;br /&gt;
      System.Windows.Forms.MouseEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      if (isDragging == true)&lt;br /&gt;
      {&lt;br /&gt;
        // The control coordinates are converted into form coordinates&lt;br /&gt;
        // by adding the label position offset.&lt;br /&gt;
        // The offset where the user clicked in the control is also&lt;br /&gt;
        // accounted for. Otherwise, it looks like the top-left corner&lt;br /&gt;
        // of the label is attached to the mouse.&lt;br /&gt;
        lblDragger.Left = e.X + lblDragger.Left - clickOffsetX;&lt;br /&gt;
        lblDragger.Top = e.Y + lblDragger.Top - clickOffsetY;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;A href=&amp;quot;http://www.nfex.ru/Code/CSharpDownload/FakeDragAndDrop.zip&amp;quot;&amp;gt;FakeDragAndDrop.zip( 23 k)&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Image Drop==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt; &lt;br /&gt;
using System;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Drawing.Imaging;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
class ImageDrop : Form {&lt;br /&gt;
    bool bIsTarget;&lt;br /&gt;
    Image image;&lt;br /&gt;
    public static void Main() {&lt;br /&gt;
        Application.Run(new ImageDrop());&lt;br /&gt;
    }&lt;br /&gt;
    public ImageDrop() {&lt;br /&gt;
        AllowDrop = true;&lt;br /&gt;
    }&lt;br /&gt;
    protected override void OnDragOver(DragEventArgs dea) {&lt;br /&gt;
        if (dea.Data.GetDataPresent(DataFormats.FileDrop) || dea.Data.GetDataPresent(typeof(Metafile)) || dea.Data.GetDataPresent(typeof(Bitmap))) {&lt;br /&gt;
            if ((dea.AllowedEffect &amp;amp; DragDropEffects.Move) != 0)&lt;br /&gt;
                dea.Effect = DragDropEffects.Move;&lt;br /&gt;
            if (((dea.AllowedEffect &amp;amp; DragDropEffects.Copy) != 0) &amp;amp;&amp;amp; ((dea.KeyState &amp;amp; 0x08) != 0))    // Ctrl key&lt;br /&gt;
                dea.Effect = DragDropEffects.Copy;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    protected override void OnDragDrop(DragEventArgs dea) {&lt;br /&gt;
        if (dea.Data.GetDataPresent(DataFormats.FileDrop)) {&lt;br /&gt;
            string[] astr = (string[])dea.Data.GetData(DataFormats.FileDrop);&lt;br /&gt;
            image = Image.FromFile(astr[0]);&lt;br /&gt;
            Invalidate();&lt;br /&gt;
        } else {&lt;br /&gt;
            if (dea.Data.GetDataPresent(typeof(Metafile)))&lt;br /&gt;
                image = (Image)dea.Data.GetData(typeof(Metafile));&lt;br /&gt;
            else if (dea.Data.GetDataPresent(typeof(Bitmap)))&lt;br /&gt;
                image = (Image)dea.Data.GetData(typeof(Bitmap));&lt;br /&gt;
            bIsTarget = true;&lt;br /&gt;
            Invalidate();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    protected override void OnMouseDown(MouseEventArgs mea) {&lt;br /&gt;
        if (image != null) {&lt;br /&gt;
            bIsTarget = false;&lt;br /&gt;
            DragDropEffects dde = DoDragDrop(image,DragDropEffects.Copy | DragDropEffects.Move);&lt;br /&gt;
            if (dde == DragDropEffects.Move &amp;amp;&amp;amp; !bIsTarget)&lt;br /&gt;
                image = null;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>