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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Drag and Drop Text

Drag and Drop Text

Scheduled Pinned Locked Moved C / C++ / MFC
learning
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.
  • S Offline
    S Offline
    sanskypotov
    wrote on last edited by
    #1

    Hi , I am trying to create an editor similar to MS VisualStudio's Resource Editor for Dialog. In this I need to create a Label, which would contain Text and be dragged around and also be resized. Can some one tell me how it can be done. Thanks, Sansky :-D

    D 1 Reply Last reply
    0
    • S sanskypotov

      Hi , I am trying to create an editor similar to MS VisualStudio's Resource Editor for Dialog. In this I need to create a Label, which would contain Text and be dragged around and also be resized. Can some one tell me how it can be done. Thanks, Sansky :-D

      D Offline
      D Offline
      Dave Glick
      wrote on last edited by
      #2

      Howdy, I think you would need to override several mouse functions in your Label class to do the following: OnLButtonDown: Track when the user clicks and if they have the left button down so that you can know what to do when they move the mouse OnLButtonUp: Again, use this to remember the mouse button state OnMouseMove: Inside here test to find out if the mouse button is down and if so, use MoveWindow to move your window to the same coordinates as the mouse is moving to I think that should do it, but this is just a guess. Hope it gives you a good direction to start looking... Dave

      S 1 Reply Last reply
      0
      • D Dave Glick

        Howdy, I think you would need to override several mouse functions in your Label class to do the following: OnLButtonDown: Track when the user clicks and if they have the left button down so that you can know what to do when they move the mouse OnLButtonUp: Again, use this to remember the mouse button state OnMouseMove: Inside here test to find out if the mouse button is down and if so, use MoveWindow to move your window to the same coordinates as the mouse is moving to I think that should do it, but this is just a guess. Hope it gives you a good direction to start looking... Dave

        S Offline
        S Offline
        sanskypotov
        wrote on last edited by
        #3

        Hi, Thanks, What I need is, how do I create, display ,move and resize Label Also I might need to display the Label in the CView, as I am not sure if I could drag and resize objects in CDialog. Any suggestions Regards, Sansky :-D

        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