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 / C++ / MFC
  4. How do I move a Static control?

How do I move a Static control?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
2 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.
  • H Offline
    H Offline
    Harshapaulp
    wrote on last edited by
    #1

    I want to move a static control when the left mouse button is down(over the static control) and I move the mouse in some direction using MFC? the Static control should move as many pixels as much as the mouse has moved. Harshapaul

    J 1 Reply Last reply
    0
    • H Harshapaulp

      I want to move a static control when the left mouse button is down(over the static control) and I move the mouse in some direction using MFC? the Static control should move as many pixels as much as the mouse has moved. Harshapaul

      J Offline
      J Offline
      Jaran Nilsen
      wrote on last edited by
      #2

      Use the WM_MOUSEMOVE message. Have a variable which keeps track of the previous mouse position, and set this after each move of the static control. When you have calculated the translation of the static control, use the MoveWindow memberfunction of the static control. I think this should work:)

      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