?? ????? ????? ???? ?? ???? ???? RichTextBox ???????? ????? ????????? ?????? ?? ????? MSDN

?????? ????????? ?????? ?????????
???? ???????: 814309 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
??????? ????? ????
????? ??? ?????? ????? ???? ?? Microsoft ??????. ????????? ?? ??? ??????? ??? ????? ??- ???? ?? ???? ??????? ??? ?????.

????? ?? ??? ???? ???? ?? Microsoft ????? ???? ???. ?????? ??? ??????? ??? ????? ?????? ??? ??? ?????? ???? ???? ??????? ??????? ?? Beta ????? ?????? ?? ???? ?? ???? ????? ???? ??? ?????? ??????? ???.
????? ???? | ?? ????

?? ??? ??????

???????

?????? ???? ???? ???? RichTextBox ?? ????????? ???????? ?? "????? ????? ???????? ?????? ?? ?????? RichTextBox ????? Windows" ??????? MSDN. ?? ???? ??????? ?? ?????? ??? ??? ???? ?? ??????. ??? ???? ?? ???? ?????? ???? ?? RichTextBox.

?????

???? ??? ??????? ???? ???? ??? ???? ??? ????? ?? ????? MSDN. ????? ?? ????? ????? ???? ???? ????? ?? ?????? ?? RichTextBox.

????

??????? ?????? ??? ??? ??????? ?? ?????? ??? DragDropRichTextBox1. ?????? ????? ?????? ????????? ???????.

Visual Basic .NET ?? Visual Basic 2005

?? ?????? ????????? ???????? ??????? ?? ????? DragDropRichTextBox1:
   Dim i As Int16 
   Dim s As String

   ' Get Start Position For the for Dropping the Text  
   i = RichTextBox1.SelectionStart
   s = RichTextBox1.Text.Substring(i)
   RichTextBox1.Text = RichTextBox1.Text.Substring(0, i)

   ' Drop the Text on to the RichTextBox
   RichTextBox1.Text = RichTextBox1.Text + e.Data.GetData(DataFormats.Text).ToString()
   RichTextBox1.Text = RichTextBox1.Text + s
   
Visual C# .NET ?? Visual C# 2005

?? ?????? ????????? ???????? ??????? ??? ???? ??? Form1 ??? ??????? InitializeComponent():
// Handler for DragDrop event
this.richTextBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.rtb_dragdrop);
????? ??????? ?????? ??? ????????? ???????? ??? ????? Main():
private void rtb_dragdrop(object sender,DragEventArgs e)
{
   int i;
   String s;
   
   // Get Start Position to Drop the Text  
   i = richTextBox1.SelectionStart;
   s = richTextBox1.Text.Substring(i);
   richTextBox1.Text = richTextBox1.Text.Substring(0,i);

   // Drop the Text on the RichTextBox
   richTextBox1.Text = richTextBox1.Text + e.Data.GetData(DataFormats.Text).ToString();
   richTextBox1.Text = richTextBox1.Text + s;
}

?????

????? ??? ?????? ??? ???????.

??????? ????

????? ????? ????? ?? ????

  1. ?? Microsoft Visual Studio .NET ?? ?? Microsoft Visual Studio 2005 ????? Windows ???? ????? ??????? ???????? Visual Basic .NET ?? Visual Basic 2005 Visual C# .NET ?? Visual C# 2005.

    ?????????? ??? ????? Form1.
  2. ?? ???????? ???? RichTextBox ???? ?????? ??? Form1.

    ??? ????? RichTextBox1Form1.
  3. ???? ??? ?????? ?????? ??? RichTextBox1 ??? ?? ???? ??? ?????.
  4. ?? ?????? "?????" ????? ?????? AllowDrop ??? True.
  5. ???? ??? ?????? ?????? ??? Form1 ??? ?? ???? ??? ??? ????????? ????????.
  6. ?? ?????? ???????? ???????? ??????? ?? ????? DragEnterRichTextBox1:

    Visual Basic .NET ?? ??? 2005 Visual Basic
       If (e.Data.GetDataPresent(DataFormats.Text)) Then
          e.Effect = DragDropEffects.Copy
       Else
          e.Effect = DragDropEffects.None
       End If
    
    Visual C# .NET ?? ??? Visual C# ?? 2005
    private void rtb_dragenter(object sender,DragEventArgs e)
    {
       if (e.Data.GetDataPresent(DataFormats.Text)) 
          e.Effect = DragDropEffects.Copy ;
       else
          e.Effect = DragDropEffects.None ;
    }
  7. ???? ???? ???? ?? ?????? ??? RichTextBox1.

    ?? ????? ????? ????.

?????

????? ?? ?????????? ?? ?????? ???? MSDN ?????? ??? ?????:

????? ?????? ????? ???????? ????? Windows ?????? RichTextBox
http://msdn2.microsoft.com/en-us/library/Aa984395(VS.71).aspx
????? ?? ????????? ??? ????? RichTextBox.DragEnter ?????? RichTextBox.DragDrop ???? ????? .NET Framework SDK ?? ?? ?????? ???? MSDN ??????:

??? RichTextBox.DragEnter
http://msdn2.microsoft.com/en-us/library/system.windows.forms.richtextbox.dragenter(vs.71).aspx

???????

???? ???????: 814309 - ????? ??? ??????: 28/???? ??????/1435 - ??????: 2.9
????? ???
  • Microsoft Visual Basic 2005
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic .NET 2002 Standard Edition
  • Microsoft Visual C# 2005 Express Edition
  • Microsoft Visual C# .NET 2003 Standard Edition
  • Microsoft Visual C# .NET 2002 Standard Edition
????? ??????: 
kbnosurvey kbarchive kbmt kbvs2005swept kbvs2005applies kbprb kbwindowsforms kbproperties kbevent kbrichedit kbdragdrop KB814309 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????814309

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com