Results 1 to 5 of 5

Thread: Drag selected text in a richtextbox

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2007
    Posts
    44

    Drag selected text in a richtextbox

    I would like to select some text in richtextbox and drag it manually else where in the same richtextbox. the problem is that when I select text in the richtextbox the cursor does not change to arrow

    thanks

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,479

    Re: Drag selected text in a richtextbox

    vb Code:
    1. Private Sub RichTextBox1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RichTextBox1.SelectionChanged
    2.      If RichTextBox1.SelectionLength > 0 Then
    3.          RichTextBox1.Cursor = Cursors.Arrow
    4.      Else
    5.          RichTextBox1.Cursor = Cursors.IBeam
    6.      End If
    7. End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Dec 2007
    Posts
    44

    Re: Drag selected text in a richtextbox

    thanks but it didn't help.

    please let me try to explain again
    when i select text in the richtextbox and then try to move it elsewhere the cursor become cursor.no which mean the operation is prohibited.

  4. #4
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: Drag selected text in a richtextbox

    (A shot in the dark) Try handling the DragDrop events (basically all events that contain Drag in the filename). It should be straightforward if such events exist (I'm not sure if they exist, that's why it's a shot in the dark )
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,479

    Re: Drag selected text in a richtextbox

    set the enableautodragdrop property to true

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width