Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Drag&Drop selected Text, anyone knows something?

Drag&Drop selected Text, anyone knows something?

Scheduled Pinned Locked Moved C#
csharpvisual-studiowinformsgraphicstutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _Kalix
    wrote on last edited by
    #1

    Hi, I've read several articles about drag&drop and know how to d&d text from one textbox to another. But if I catch the MouseDown event, I can't select text or if I select text it becomes unselected if I try to drag it. My target is to select and drag and drop text like in Visual Studio itself (Just from one textbox to another). I tried several workarounds, but no one works as expected. My environment is Visual Studio, graphics library is default Windows Forms. I would appreciate helpfull hints, thank you. :^) :sigh: :doh: :) :-D Kalix

    N 1 Reply Last reply
    0
    • _ _Kalix

      Hi, I've read several articles about drag&drop and know how to d&d text from one textbox to another. But if I catch the MouseDown event, I can't select text or if I select text it becomes unselected if I try to drag it. My target is to select and drag and drop text like in Visual Studio itself (Just from one textbox to another). I tried several workarounds, but no one works as expected. My environment is Visual Studio, graphics library is default Windows Forms. I would appreciate helpfull hints, thank you. :^) :sigh: :doh: :) :-D Kalix

      N Offline
      N Offline
      n10sive
      wrote on last edited by
      #2

      you want to check to see if there is selected text first (selected text length > 1). If there is, you are doing a drag/drop. If not, you are selecting text. This is how you make the distinction. hope this helps

      _ 1 Reply Last reply
      0
      • N n10sive

        you want to check to see if there is selected text first (selected text length > 1). If there is, you are doing a drag/drop. If not, you are selecting text. This is how you make the distinction. hope this helps

        _ Offline
        _ Offline
        _Kalix
        wrote on last edited by
        #3

        Thanks for your reply. I tried to check the SelectionLength and SelectedText propertys, but if I start to drag the text becomes unselected. It would work, if the MouseDown event is fired before the unselection. :doh: Does anybody have an idea?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups