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. Move a Textbox with the curson in run-time

Move a Textbox with the curson in run-time

Scheduled Pinned Locked Moved C#
csharpquestion
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.
  • N Offline
    N Offline
    NewbieDude
    wrote on last edited by
    #1

    Hey howzit? I would like to beable to move a textbox that is on my form with my cursor to anywhere on the form in run-time? Is this possible, could you perhaps give me a code snippet? I am very new to C#! Thanks!

    O 1 Reply Last reply
    0
    • N NewbieDude

      Hey howzit? I would like to beable to move a textbox that is on my form with my cursor to anywhere on the form in run-time? Is this possible, could you perhaps give me a code snippet? I am very new to C#! Thanks!

      O Offline
      O Offline
      osamahmirza
      wrote on last edited by
      #2

      Yes it is possible and easy too. Try to play around with "Location" property of your control e.g in MouseMove event try to do following Textbox1.Location = new point(Textbox1.Location.X+/*mouse X cordinate*/,Textbox1.Location.Y+/*mouse Y cordinate*/); I hope it helps!

      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