Visual Studio 2013 - WPF properties freeze periodically - c#

My properties window (WPF & C#) will "freeze" after sometime, meaning that I can not edit values, as I can not even enter the textboxes. Weirdly enough, I do can edit anything without text boxes (such as colors, gradients and check boxes).
I have marked red the elements I can not even enter, and green the elements which I can edit normally.
The XAML editor works fine, it is just the properties window. Restarting Visual Studio fixes the problem, aber after 10-30 minutes, the problem repeats.
I'm using Visual Studio Update 4 Community Edition.

I found that selecting one of the properties that works (such as Brush) unfreezes all the properties and events solving the issue in a simple fashion.

Related

Visual Studio Code Order In AutoCompletion

I recently switched to Visual Studio Code and I love it! It starts so quickly andI just enjoy the open source environment more than Visual Studio. But there's one problem that I have encountered that bothers me more than it should.
Before I could if I wanted to autocomplete the syntax for an if statement I'd just be able to type in "if" and touble tap tab, but now the autocompletion IntelliSense things pop up in the wrong order:
The red box is the wrong one that gets displayed first and the green box is the one I want at the top. My question is if there's a way to configure it so that I get that statement at the top. It's the same with for-loops, foreach-loops and pretty much every other autocompletion that I want to use.
Create snippet (or edit) ctrl+shift+p Preferences: Configure User Snippets
settings (ctrl+,)
"editor.snippetSuggestions": "top",

testrun of form in visual studio c# shows a visible small scale version of it

i recently installed visual studio 2015 and made my first code in c#.
('maximized' for window state at the properties of the form)
everything went fine (comilation and testrun without errors) until i attempted to load one of the example tutorials, which i interrupted during loading.
after that i compiled and started my self coded application again from within visual studio. this time the output of the form was, unlike before, displayed half its size.
all the buttons including the window of the form appeared half its original size.
but when i executed the comiled application outside of visual studio (without it actually running) the application started in normal scale as intended.
this effect happens for this specific project only. if i start a new project the compilation & testrun will show a form scale as expected.
so my question: is there any magical setting that i have to change to end this nightmare ? i dont like to start all over again with a new project. i had set up 72 different button already. each buttonpress causes a different
SendKeys.Send("");
to be executed.
Check the Form's AutoScaleMode property!
The default is Font:
Controls scale relative to the dimensions of the font the classes are
using, which is typically the system font.
If that won't help do try to create a new project and copy the relevant cs-files into it!
In theory there is a zoom option in the VS designer, but at least in the Winforms desiner the shortcut does nothing for me.. It probably is for the WPF designer.
You did tag the question correctly and it is indeed about Winforms?

Can't Move Controls With Mouse on Windows Form Designer

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.
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.
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.
I had this happening using multiple monitors.
Move VS to the main monitor (1) and all will work fine.
Greetz
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!
In my case, I had to change the Dock property to None.
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.
I just found myself in similar, but slightly different situation - I could drag all controls without the "cross" icon such as buttons, but could not drag any control that had the "cross" icon such as group boxes and panels. One workaround that worked was to use the "arrow" keys to move the controls, but only a computer reboot fixed the issue. The solution, posted by Brett Wolfington did not work in my case.
Found a solution!!
I had the same problem:
Holding the mouse button and trying to move the element with no effects!
My solution:
Try after pressing the mouse button to move the element very slowely - it works!
I think it has maybe something to do with the mouse speed/acceleration settings. I changed them to the maximum. I guess VS has a problem with that. When i move the mouse slowely at the beginning then it works just fine!
Answer to a slightly different question, but my googling lead me here, so perhaps it helps someone else.
If no movement works, also not with keyboard, check the "locked" property. That was it for me in a colleagues project, so I was not aware he had locked it.
The controls also have a tiny lock icon so if you look closely you will notice.
None of these solutions worked for me. These are the steps that worked for me:
Close Visual Studio
Delete the Visual Studio AppData folder, usually at C:\Users\user.name\AppData\Local\Microsoft\VisualStudio. My folder was named 15.0_b148b13d, but your folder may have a similar name.
After deleting, Visual Studio took some time to initialize but I could finally drag the controls.
Seems its a drawing error. The controls actually moves, but there is a short time delay before you see it!

In visual studio 2010, when I open a form in design view - some numbers showing up next to each control

I keep seeing these odd looking numbers on just one of the forms in my application. Any idea why this appears - this doesn't cause any trouble in running the application, but I need to make some changes in the design and the regular selection borders are not visible.
These may be the tab orders, but couldn't find out how to remove/ hide these.
All help would be appreciated.
Upen
Got the answer guys- in the main vs2010 main menu- go to View--> taborder - click to toggle off or on.

XAML Editor hangs for 4-10 seconds driving me mad

I know similar questions exists but they don't address this exact problem.
I'm having an issue with Visual Studio 2008 SP1 whereby it hangs for 4-10 seconds whenever the xaml edit receives focus. It is literally driving me to despair and I'm about to move back to Winforms. Note - Just editing the straight up xaml (i.e no designer enabled) doesn't fix the issue.
I have done the following :
Disable the xaml designer
Disable all plugins Checked FileMon for activity during the hang (there is none)
Checked Disk / Paging for activity the hang (again, none)
Uninstalled Silverlight
Setup :
Windows XP64
8 Core Zeon, 16Gb RAM
The designer for XAML in VS 2008 is weak. Many of these issues have been addressed and dramatically improved in VS 2010 (even in beta 2).
I've started using Blend exclusively for designer-work, and just setup VS to use the XML editor (instead of the designer) for dealing with XAML files. This makes editing instantaneous within Visual Studio, although you need to swap out to Blend if you want a design time experience.
For me, the XML editor just didn't quite work right. What I did was in Tools/Options/Text Editor/XAML/Miscellaneous, activate "Always open documents in full XAML view." This prevents the IDE from trying to render your xaml at open and get right to editing your XAML. When you are ready to pay the render penalty, you can click on the design tab.
Because everyone knows writing xaml by hand is faster and more fun :)
I had exactly same issue with XAML editor - every time I focused, saved, opened XAML code, the Visual Studio got stuck for few seconds.
For me the solution was removing reference to Microsoft.mshtml - I don't understand the reason (if someone does, please comment), but it really was the only problem and removing the reference solved my nightmare.

Categories

Resources