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#
  4. User located controls

User located controls

Scheduled Pinned Locked Moved C#
csharptutorial
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.
  • R Offline
    R Offline
    Ron Modesitt
    wrote on last edited by
    #1

    Can anyone give me (rookie C# programmer) an idea how to use standard controls that can be dragged to a new location by the user during program execution. I would like to use various controls (TextBox, Button) to graphically represent a continuous beam (structural engineering) containing the member information (length, moment of intertia, cross sectional area, joint details, loads, etc). Thanks in advance

    Ron Modesitt

    G 1 Reply Last reply
    0
    • R Ron Modesitt

      Can anyone give me (rookie C# programmer) an idea how to use standard controls that can be dragged to a new location by the user during program execution. I would like to use various controls (TextBox, Button) to graphically represent a continuous beam (structural engineering) containing the member information (length, moment of intertia, cross sectional area, joint details, loads, etc). Thanks in advance

      Ron Modesitt

      G Offline
      G Offline
      Guinness4Strength
      wrote on last edited by
      #2

      This is probably not a rookie task ;) Just as a starting point I would begin by monitoring the Mouse Button Click events as follows: In the Mouse Button Down event I would record the coordinates of the mouse pointer and the control being clicked. Then in the button Up event I would check the coordinates of the mouse again. If the delta between the starting and new locations are greater than, say, the size of the control oringall clicked (or some other specific value) then set the Location property of the control to the new coordinates. This approach will not create the dragging effect visually but it should move the controls for you. Good Luck.

      R 1 Reply Last reply
      0
      • G Guinness4Strength

        This is probably not a rookie task ;) Just as a starting point I would begin by monitoring the Mouse Button Click events as follows: In the Mouse Button Down event I would record the coordinates of the mouse pointer and the control being clicked. Then in the button Up event I would check the coordinates of the mouse again. If the delta between the starting and new locations are greater than, say, the size of the control oringall clicked (or some other specific value) then set the Location property of the control to the new coordinates. This approach will not create the dragging effect visually but it should move the controls for you. Good Luck.

        R Offline
        R Offline
        Ron Modesitt
        wrote on last edited by
        #3

        Many thanks. I agree this is not a rookie task, however, your suggestion is a good idea and one that this rookie understands.

        Ron Modesitt

        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