Reputation: 354854
This morning I stumbled over a weird issue in Visual Studio's Windows Forms designer. I have a form which worked for about a month now without changes. It looks like this in the application:
(text made unreadable because I'm not entirely sure of the legal implications here).
Now starting today, apparently (I think I had the form open in the designer yesterday without problems) it looks like this in the designer:
Looking at the diff, every control (or nearly every one—labels were not affected, but that may be related to AutoSize) got a width of 311 pixels. Lines like the following are common throughout the file after the designer messed with it:
this.panel1.Size = new System.Drawing.Size(311, 24);
Wherever that value comes from. Furthermore one label got the interesting text "潐瑲⼠倠獯瑩潩㩮攀瑵慲ⱬ"
(it doesn't make any more sense in its raw bytes).
When I don't open the form in the designer nothing bad happens, the project even builds when the files are untouched and it looks fine when running the program. But opening the designer triggers aforementioned changes in the designer-generated code and those changes persist when compiling (obviously).
On a co-worker's machine this doesn't happen at all (yet he can't open datasets without crashing VS, so perhaps both setups here are a little weird ...).
I seriously wonder what's going on here. Any ideas?
ETA: I can't change size of the controls in the designer once it went on its resizing rampage. Resizing merely causes some visual artifacts as if the control was resized but it's still at 311 px width when checking.
ETA 2: Weirdly enough: Opening the designer (causes corruption, so far so good), then going into pending changes with AnkhSVN and reverting all changes to the files reverts the corruption too. The form looks like it should even in the designer. Until I close and re-open it again.
Upvotes: 3
Views: 1957
Reputation: 354854
I found the culprit. I recently installed RockScroll. And while I couldn't directly link that behavior to RockScroll I noticed that some forms had the scrollbar replacement of it drawn over them. And controls on that form changed size without reason.
Uninstalled RockScroll and it solved the problem. Thanks for all the input, anyway.
Upvotes: 4
Reputation: 32416
Have you tried to clean your project ? (I'm afraid it won't solve anything, but it's an easy step worth trying)
Also, could you clean your Visual Studio cache ? It worked numerous times for me in similar situations.
Here are some links regarding the VS Cache Hell : 1 2 . Please feel free to edit my post if you find some other useful information regarding this.
Upvotes: 1
Reputation: 51302
Are you doing some manual layout or anchoring in form's constructor or OnPaint methods? I once had a similar problem because I was trying to modify some elements' positions manually, and designer was passing an invalid ClientRectangle (or something) while rendering.
Upvotes: 0
Reputation: 1924
Maybe you have recently installed another language pack (Korean maybe).
Upvotes: 0
Reputation: 32416
It's possible to do that in one click in the designer using the "make same width" tool.
In my experience, if Visual is freezed during a build, it's pretty common to click at a random location on the screen to test whether VS is done with the current task)
Just an idea, though.
Upvotes: 0