<?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%2FCSharp_Tutorial%2FGUI_Windows_Forms%2FDrag_Drop</id>
		<title>Csharp/CSharp Tutorial/GUI Windows Forms/Drag Drop - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FGUI_Windows_Forms%2FDrag_Drop"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Drag_Drop&amp;action=history"/>
		<updated>2026-04-30T05:47:02Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Drag_Drop&amp;diff=5457&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Drag_Drop&amp;diff=5457&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</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/CSharp_Tutorial/GUI_Windows_Forms/Drag_Drop&amp;diff=5458&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Drag_Drop&amp;diff=5458&amp;oldid=prev"/>
				<updated>2010-05-26T12:15:34Z</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 TextBox==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
public class TextBoxDragDropDemo : Form&lt;br /&gt;
{&lt;br /&gt;
    public TextBoxDragDropDemo()&lt;br /&gt;
    {&lt;br /&gt;
        InitializeComponent();&lt;br /&gt;
    }&lt;br /&gt;
    private void TextBox_MouseDown(object sender, MouseEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        TextBox txt = (TextBox)sender;&lt;br /&gt;
        txt.SelectAll();&lt;br /&gt;
        txt.DoDragDrop(txt.Text, DragDropEffects.Copy);&lt;br /&gt;
    }&lt;br /&gt;
    private void TextBox_DragEnter(object sender, DragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        if (e.Data.GetDataPresent(DataFormats.Text))&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 TextBox_DragDrop(object sender, DragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        TextBox txt = (TextBox)sender;&lt;br /&gt;
        txt.Text = (string)e.Data.GetData(DataFormats.Text);&lt;br /&gt;
    }&lt;br /&gt;
    [STAThread]&lt;br /&gt;
    public static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        Application.Run(new TextBoxDragDropDemo());&lt;br /&gt;
    }&lt;br /&gt;
    private System.Windows.Forms.TextBox TextBox2;&lt;br /&gt;
    private System.Windows.Forms.TextBox TextBox1;&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
        this.TextBox2 = new System.Windows.Forms.TextBox();&lt;br /&gt;
        this.TextBox1 = new System.Windows.Forms.TextBox();&lt;br /&gt;
        this.SuspendLayout();&lt;br /&gt;
        this.TextBox2.AllowDrop = true;&lt;br /&gt;
        this.TextBox2.Location = new System.Drawing.Point(28, 129);&lt;br /&gt;
        this.TextBox2.Multiline = true;&lt;br /&gt;
        this.TextBox2.Size = new System.Drawing.Size(196, 77);&lt;br /&gt;
        this.TextBox2.DragDrop += new System.Windows.Forms.DragEventHandler(this.TextBox_DragDrop);&lt;br /&gt;
        this.TextBox2.DragEnter += new System.Windows.Forms.DragEventHandler(this.TextBox_DragEnter);&lt;br /&gt;
        this.TextBox2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TextBox_MouseDown);&lt;br /&gt;
        this.TextBox1.AllowDrop = true;&lt;br /&gt;
        this.TextBox1.Location = new System.Drawing.Point(28, 36);&lt;br /&gt;
        this.TextBox1.Multiline = true;&lt;br /&gt;
        this.TextBox1.Size = new System.Drawing.Size(196, 77);&lt;br /&gt;
        this.TextBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.TextBox_DragDrop);&lt;br /&gt;
        this.TextBox1.DragEnter += new System.Windows.Forms.DragEventHandler(this.TextBox_DragEnter);&lt;br /&gt;
        this.TextBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TextBox_MouseDown);&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(292, 266);&lt;br /&gt;
        this.Controls.Add(this.TextBox2);&lt;br /&gt;
        this.Controls.Add(this.TextBox1);&lt;br /&gt;
        this.ResumeLayout(false);&lt;br /&gt;
        this.PerformLayout();&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drag Drop Sample==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;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 DragDropForm : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    private System.Windows.Forms.ListBox lbDragDropSource;&lt;br /&gt;
    private System.Windows.Forms.Splitter splitterCentral;&lt;br /&gt;
    private System.Windows.Forms.TextBox txtMain;&lt;br /&gt;
    public DragDropForm()&lt;br /&gt;
    {&lt;br /&gt;
      InitializeComponent();&lt;br /&gt;
      this.lbDragDropSource.Items.Add(&amp;quot;&amp;lt;html&amp;gt;&amp;quot;);&lt;br /&gt;
      this.lbDragDropSource.Items.Add(&amp;quot;&amp;lt;head&amp;gt;&amp;quot;);&lt;br /&gt;
      this.lbDragDropSource.Items.Add(&amp;quot;&amp;lt;title&amp;gt;&amp;quot;);&lt;br /&gt;
      this.lbDragDropSource.Items.Add(&amp;quot;&amp;lt;/title&amp;gt;&amp;quot;);&lt;br /&gt;
      this.lbDragDropSource.Items.Add(&amp;quot;&amp;lt;/head&amp;gt;&amp;quot;);&lt;br /&gt;
      this.lbDragDropSource.Items.Add(&amp;quot;&amp;lt;body&amp;gt;&amp;quot;);&lt;br /&gt;
      this.lbDragDropSource.Items.Add(&amp;quot;&amp;lt;/body&amp;gt;&amp;quot;);&lt;br /&gt;
      this.lbDragDropSource.Items.Add(&amp;quot;&amp;lt;/html&amp;gt;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    private void InitializeComponent()&lt;br /&gt;
    {&lt;br /&gt;
      this.lbDragDropSource = new System.Windows.Forms.ListBox();&lt;br /&gt;
      this.splitterCentral = new System.Windows.Forms.Splitter();&lt;br /&gt;
      this.txtMain = new System.Windows.Forms.TextBox();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // lbDragDropSource&lt;br /&gt;
      // &lt;br /&gt;
      this.lbDragDropSource.Dock = System.Windows.Forms.DockStyle.Left;&lt;br /&gt;
      this.lbDragDropSource.Font = new System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));&lt;br /&gt;
      this.lbDragDropSource.IntegralHeight = false;&lt;br /&gt;
      this.lbDragDropSource.ItemHeight = 20;&lt;br /&gt;
      this.lbDragDropSource.Name = &amp;quot;lbDragDropSource&amp;quot;;&lt;br /&gt;
      this.lbDragDropSource.Size = new System.Drawing.Size(152, 301);&lt;br /&gt;
      this.lbDragDropSource.TabIndex = 0;&lt;br /&gt;
      this.lbDragDropSource.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lbDragDropSource_MouseDown);&lt;br /&gt;
      this.lbDragDropSource.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.lbDragDropSource_QueryContinueDrag);&lt;br /&gt;
      // &lt;br /&gt;
      // splitterCentral&lt;br /&gt;
      // &lt;br /&gt;
      this.splitterCentral.Location = new System.Drawing.Point(152, 0);&lt;br /&gt;
      this.splitterCentral.Name = &amp;quot;splitterCentral&amp;quot;;&lt;br /&gt;
      this.splitterCentral.Size = new System.Drawing.Size(3, 301);&lt;br /&gt;
      this.splitterCentral.TabIndex = 1;&lt;br /&gt;
      this.splitterCentral.TabStop = false;&lt;br /&gt;
      // &lt;br /&gt;
      // txtMain&lt;br /&gt;
      // &lt;br /&gt;
      this.txtMain.AcceptsReturn = true;&lt;br /&gt;
      this.txtMain.AcceptsTab = true;&lt;br /&gt;
      this.txtMain.AllowDrop = true;&lt;br /&gt;
      this.txtMain.Dock = System.Windows.Forms.DockStyle.Fill;&lt;br /&gt;
      this.txtMain.Font = new System.Drawing.Font(&amp;quot;Microsoft Sans Serif&amp;quot;, 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));&lt;br /&gt;
      this.txtMain.Location = new System.Drawing.Point(155, 0);&lt;br /&gt;
      this.txtMain.Multiline = true;&lt;br /&gt;
      this.txtMain.Name = &amp;quot;txtMain&amp;quot;;&lt;br /&gt;
      this.txtMain.Size = new System.Drawing.Size(333, 301);&lt;br /&gt;
      this.txtMain.TabIndex = 2;&lt;br /&gt;
      this.txtMain.Text = &amp;quot;&amp;quot;;&lt;br /&gt;
      this.txtMain.DragOver += new System.Windows.Forms.DragEventHandler(this.txtMain_DragOver);&lt;br /&gt;
      this.txtMain.DragDrop += new System.Windows.Forms.DragEventHandler(this.txtMain_DragDrop);&lt;br /&gt;
      this.txtMain.TextChanged += new System.EventHandler(this.txtMain_TextChanged);&lt;br /&gt;
      // &lt;br /&gt;
      // DragDropForm&lt;br /&gt;
      // &lt;br /&gt;
      this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);&lt;br /&gt;
      this.ClientSize = new System.Drawing.Size(488, 301);&lt;br /&gt;
      this.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                      this.txtMain,&lt;br /&gt;
                                      this.splitterCentral,&lt;br /&gt;
                                      this.lbDragDropSource});&lt;br /&gt;
      this.Name = &amp;quot;DragDropForm&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;Drag and Drop Sample&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new DragDropForm());&lt;br /&gt;
    }&lt;br /&gt;
    private void lbDragDropSource_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      int nSelectedIndex = lbDragDropSource.SelectedIndex;&lt;br /&gt;
      string strItem = (string)lbDragDropSource.Items[nSelectedIndex];&lt;br /&gt;
      DragDropEffects dde = lbDragDropSource.DoDragDrop(strItem,&lt;br /&gt;
        DragDropEffects.Copy);&lt;br /&gt;
      if (DragDropEffects.None == dde)&lt;br /&gt;
        MessageBox.Show(&amp;quot;Our drag and drop offer was not accepted.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    private void txtMain_DragOver(object sender, System.Windows.Forms.DragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      if (e.Data.GetDataPresent(typeof(string)))&lt;br /&gt;
      {&lt;br /&gt;
        e.Effect = DragDropEffects.Copy;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    private void txtMain_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      if (e.Data.GetDataPresent(typeof(string)))&lt;br /&gt;
      {&lt;br /&gt;
        string strData = (string)e.Data.GetData(typeof(string));&lt;br /&gt;
        txtMain.AppendText(strData);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    private void lbDragDropSource_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      // DO NOT DO THIS&lt;br /&gt;
      // e.Action = DragAction.Continue;&lt;br /&gt;
    }&lt;br /&gt;
    private void txtMain_TextChanged(object sender, System.EventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
    &lt;br /&gt;
    }&lt;br /&gt;
  }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==File Drop Target==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;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;
using System.IO;&lt;br /&gt;
  public class FileDropTargetForm : System.Windows.Forms.Form&lt;br /&gt;
  {&lt;br /&gt;
    private System.Windows.Forms.TextBox txtMain;&lt;br /&gt;
    public FileDropTargetForm()&lt;br /&gt;
    {&lt;br /&gt;
      this.txtMain = new System.Windows.Forms.TextBox();&lt;br /&gt;
      this.SuspendLayout();&lt;br /&gt;
      // &lt;br /&gt;
      // txtMain&lt;br /&gt;
      // &lt;br /&gt;
      this.txtMain.AcceptsReturn = true;&lt;br /&gt;
      this.txtMain.AcceptsTab = true;&lt;br /&gt;
      this.txtMain.AllowDrop = true;&lt;br /&gt;
      this.txtMain.Dock = System.Windows.Forms.DockStyle.Fill;&lt;br /&gt;
      this.txtMain.Multiline = true;&lt;br /&gt;
      this.txtMain.Name = &amp;quot;txtMain&amp;quot;;&lt;br /&gt;
      this.txtMain.ScrollBars = System.Windows.Forms.ScrollBars.Both;&lt;br /&gt;
      this.txtMain.Size = new System.Drawing.Size(292, 273);&lt;br /&gt;
      this.txtMain.TabIndex = 0;&lt;br /&gt;
      this.txtMain.Text = &amp;quot;&amp;quot;;&lt;br /&gt;
      this.txtMain.DragOver += new System.Windows.Forms.DragEventHandler(this.txtMain_DragOver);&lt;br /&gt;
      this.txtMain.DragDrop += new System.Windows.Forms.DragEventHandler(this.txtMain_DragDrop);&lt;br /&gt;
      this.txtMain.TextChanged += new System.EventHandler(this.txtMain_TextChanged);&lt;br /&gt;
      // &lt;br /&gt;
      // FileDropTargetForm&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.Controls.AddRange(new System.Windows.Forms.Control[] {&lt;br /&gt;
                                      this.txtMain});&lt;br /&gt;
      this.Name = &amp;quot;FileDropTargetForm&amp;quot;;&lt;br /&gt;
      this.Text = &amp;quot;FileDrop Target&amp;quot;;&lt;br /&gt;
      this.ResumeLayout(false);&lt;br /&gt;
    }&lt;br /&gt;
    static void Main() &lt;br /&gt;
    {&lt;br /&gt;
      Application.Run(new FileDropTargetForm());&lt;br /&gt;
    }&lt;br /&gt;
    private void txtMain_DragOver(object sender, System.Windows.Forms.DragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      if (e.Data.GetDataPresent(DataFormats.FileDrop))&lt;br /&gt;
      {&lt;br /&gt;
        e.Effect = DragDropEffects.Copy;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    private void txtMain_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
      if (e.Data.GetDataPresent(DataFormats.FileDrop))&lt;br /&gt;
      {&lt;br /&gt;
        string[] strFiles = (string[])e.Data.GetData(DataFormats.FileDrop);&lt;br /&gt;
        StreamReader reader = new StreamReader(strFiles[0]);&lt;br /&gt;
        this.txtMain.Clear();&lt;br /&gt;
        this.txtMain.Text = reader.ReadToEnd();&lt;br /&gt;
        reader.Close();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    private void txtMain_TextChanged(object sender, System.EventArgs e)&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>