Can't Move Controls With Mouse on Windows Form Designer

43,374

Solution 1

It took some time but I finally found a workaround, if not an answer. As it happens, periodically my computer will stop allowing me to drag-and-drop anything. The solution to this is to press the Esc (escape) key, which instantly restores functionality.

Solution 2

I had this happening using multiple monitors. Move VS to the main monitor (1) and all will work fine. Greetz

Solution 3

I know this is an older thread, but this problem still persists. I am putting this here because I think some of these may work for others. The top option works for me, but is by no means a permanent solution. It helps to get your project completed though. Design your forms on your main screen then move VS to your secondary monitor to code kinda thing. I work off a laptop, so I don't like working on a small screen.

Some steps are rudimentary, but I was trying to be thorough. Sometimes it's the simple solution.

Preliminary troubleshooting...

  • Moving VS to main monitor(1) - this worked for me, but still doesn't allow me to use my 2 monitors
  • Run installer, select Repair
  • Run and cancel your project
  • Press the Esc button and see if things return to normal
  • Right click form "Lock Controls". This should not have the blue outline, or right click on form/control>Lock Controls and make sure nothing is locked.
  • Rebuild project, close and open the form again.
  • Snap to grid setting - Tools>Options>Windows Form Designer>General
  • Restart VS with 100% scaling - drawing may be an issue. I am not convinced it is not here since it works on the main screen but not the 2nd or 3rd
  • Dock property set to none for form/controls
  • Moving items very slowly with mouse - another indication drawing may be an issue.
  • Controls may not be docked in the container in which they reside. Restart VS. Try double clicking on the control, then move. I think this is indicative of creating the control outside a container(say, on a form), dragging it into another container(say, a tabControl) and then it not moving within that tabControl. Additionally, try creating new controls within their intended container and then trying to move them.
  • Close VS, delete C:\Users\user.name\AppData\Local\Microsoft\VisualStudio\15.0_xxxxxxxxx folder
  • Mouse driver - some software may cause issues here.
  • Absolute positioning - Tools>Options>Web Form Designer>CSS Styling>Change position...
  • Right click any item under toolbox and select "reset toolbox"

Requires Reboot...

  • Close VS. Delete some config files with current dates (devenv.exe.config, toolbox.tbd, toolbox_reset.tbd, toolboxindex.tbd, toolboxindex_reset.tbd) and reboot the PC. These are found in a directory like C:\Users\tdevy97\AppData\Local\Microsoft\VisualStudio\15.0_18c2eb4a where the last folder(15.0_18c2eb4a) is some random name. Reboot. Restart VS.

  • Corrupt toolbox? Close Visual Studio, Open the “c:\Users\AppData\Local\Microsoft\VisualStudio\14.0” folder and remove all the .TBD files, Start regedit, Find the “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\ToolboxControlsInstaller_AssemblyFoldersExCache” and “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\ToolboxControlsInstallerCache” keys, Remove everything from these keys leaving them empty, before you removing it, (back up your registry first), Reboot, Run Visual Studio again and wait until it recreates all items in the toolbox.

Last resorts...

  • Open command prompt as admin, navigate to your "IDE" directory (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE) and run the following commands...

    • devenv.exe /resetskippkgs, it will clear all SkipLoading tags that have been added to VSPackages by users who want to avoid loading problem VSPackages.
    • devenv.exe /resetsettings, it will restore Visual Studio default settings. Optionally resets the settings to the specified .vssettings file.
    • devenv.exe /resetuserdata, it will take a couple of minutes to run as Visual Studio cleans up and sets itself back to its original state. You may open Task Manager at this point to check whether the devenv.exe process is still running. After it has completed running, you can restart Visual Studio.
  • devenv.exe /uninstall /force - complete uninstall. Reboot. Reinstall. Rock on!

Solution 4

In my case, I had to change the Dock property to None.

Solution 5

I had this issue and tried solving it using some of the aforementioned methods, including pressing Esc, rebooting, and deleting the folder in AppData, but none of these worked for me.

"Solution"
I have a dual screen setup, and what I eventually did notice is that if Visual Studio starts up on Screen 1 and is then moved to Screen 2, the components will snap back to their initial location after being clicked and dragged. After moving the Visual Studio window back to Screen 1, the components click and drag as usual. I am unsure of the cause of this since it never used to be a problem, but for anyone using dual/multiple screens, this may "solve" the issue.

Share:
43,374

Related videos on Youtube

Brett Wolfington
Author by

Brett Wolfington

I have a degree in Computer Science from Kansas State University. I am currently employed as the General Manager of the WV Great Barrel Company in Caldwell, WV. I manage a highly-automated whiskey barrel cooperage, which has allowed me a platform to apply my programming skills in a variety of ways. While programming is not my job, it is a powerful tool in my arsenal, and has allowed me to increase my productivity considerably. My expertise is primarily in the following areas and technologies: Computer Programming C# - ASP.NET, EF, Blazor, WinForms, UWP, Unit Testing, MS Office automation C++ - OpenCV, OpenGL, Network programming HTML/CSS Javascript (+jQuery), Typescript Angular PHP PLC control logic (Ladder, STL, FB) - Siemens and AB Typescript Software Microsoft Excel Microsoft Visual Studio (+ Code) Eclipse AutoCAD Minitab General Statistics (I'm a Six Sigma Black Belt) Mathematics & Numerical Analysis Outside of my job and my technical hobbies, I enjoy hiking, skiing, mountaineering, and rock climbing.

Updated on July 09, 2022

Comments

  • Brett Wolfington
    Brett Wolfington almost 2 years

    I recently installed Visual Studio 2013 Professional, and found that in the Windows Forms Application project type I'm unable to move any controls on a form in design mode. I tested a few alternatives out and found the following:

    • Controls can be moved with the keyboard
    • Controls can be resized by dragging the keypoints on the outline of the control
    • Controls can be aligned using the commands in the Tools menu
    • Controls can be moved by setting the Location field manually in the designer property grid
    • Controls can be docked
    • Controls cannot be moved with the mouse

    Furthermore, as you can see in the image below, the "cross" icon that indicates that the controls are movable is not visible on any controls.

    A form showing no visible cross icon

    I've tried the following, but have not yet been able to correct the issue:

    • Created a new project & solution (same issue)
    • Created a new form (same issue)
    • Verified that the Locked property of both the form and controls is set to False
    • Verified that the form inherits from Form (as expected, as this is a standard installation and the first time I've used it)
    • Googled for help (nothing that worked)

    Any suggestions would be appreciated.

    • Lex Li
      Lex Li about 10 years
      Cannot reproduce. Please contact Microsoft support via support.microsoft.com
    • jhyap
      jhyap about 10 years
      try reinstall the VS2013?
    • TaW
      TaW about 10 years
      FYI: The cross only shows for some more complicated container controls. It is not supposed to show for a simple button. Try a restart of VS and then of your PC first..
  • Brett Wolfington
    Brett Wolfington almost 9 years
    While I can't speak for everyone experiencing this problem, in my situation the error was not a drawing error or delay.
  • Fetchez la vache
    Fetchez la vache over 8 years
    "this won't work... I can drag windows about. See now I hit Escape and... Ooh! it works!." Have a vote :)
  • harsimranb
    harsimranb over 8 years
    I had to restart my computer. Next time I will try this solution.
  • Zachary Cutler
    Zachary Cutler almost 8 years
    I had the same issue in the Workflow Designer and this solved that to. Thanks!
  • Marc Roussel
    Marc Roussel over 7 years
    ESC has no effect for me. Everything on the form is not movable with mouse. I can use the arrows and the controls move. I will try a restart of the computer since restarting VS 2015 Enterprise Update 1 has no effect either.
  • Marc Roussel
    Marc Roussel over 7 years
    Finally it was a Windows 10 bug as we restarted the PC and it worked like a charm. We found out when we were not able to move icon on the desktop as well.
  • bjan
    bjan about 7 years
    yes it is the case, move the mouse very slowly, when the control gets dragged then you can drag faster. In this case alignment suggestions don't work.
  • Amarnasan
    Amarnasan about 5 years
    Hitting <ESC> worked for me. I can't believe it... Thank you, anyway!
  • nam
    nam almost 5 years
    @BrettWolfington I appreciate you sharing your solution, it resolved my issue. More importantly it was important that you marked your own response as an Answer - as it gets people attention more (as was the case with me).
  • Eric F
    Eric F over 4 years
    This worked for me! Strange.. and makes me wonder why it happens
  • A Burns
    A Burns over 3 years
    Also worked for me December 2020, VS 2019
  • Diogo
    Diogo over 3 years
    Ah! Finally a solution! Thanks ;)
  • Ben J
    Ben J almost 3 years
    Worked for me on VS 2019. Also, the controls that I couldn't move were inside a tab control. Controls outside the tab control (even on second monitor) were moveable.
  • Andreas
    Andreas over 2 years
    I had the same issue with the dataset designer in VS 2013 and pressing ESC let me move tables again. Thanks a million!
  • John Foll
    John Foll over 2 years
    I had this same problem in VS 2019 too. Thanks for your solution!
  • Yeshurun Kubi
    Yeshurun Kubi about 2 years
    Worked for me as well. Strange that this strange bug is still there (April 2022, CS 2019).
  • Andrei Sfrent
    Andrei Sfrent about 2 years
    Sorry, what the... it worked indeed, does anyone know what is the deal? I even restarted VS, the problem was still there, so maybe it is a Windows issue as someone mentioned above. Still, I am dying to figure out how pressing Esc solves it... I am stunned.