Visual studio 2008 Professional Edition acting weird - visual-studio

I have a weird situation on a winform project.
I have user control (with 600 lines of code around) with a datagridview. I change de ColumnHeaderStyle of the font and save it. After I save the file I close it and open again, the changes were not saved (although the asterisk is dissapeared), because the ColumnHeaderStyle is back to the former value. This is driving me crazy because I cannot change any visual thing in the Designer.
Any clue?
Thanks in advance.

I've had occasional very strange behaviour with VS2008 developing WinForms apps too. Mostly designers that won't display (even though nothing has changed), but I've had cases of disappearing controls, too (and hence compilations that won't complete since code then refers to controls that are no longer being created). All very irritating.
Assuming that you've done all the standard things, like Cleaning the solution (on the Solution's context menu), deleting all the relevant Bin and Obj folders (no idea why this would cures VS weirdnesses, but it sometimes does) and rebuilding (ensuring that the Designer for your user control is closed when you rebuild)...
... you might try looking through the designer code for some strange 'bonus' controls that apparently have nothing to with you.
In one particularly intractable case, I eventually noticed some controls with names like Button_01, Button_02, etc, whose origin I couldn't identify. They were being defined but not instantiated, and not being added to any controls collections, and I just deleted all references to them.
When I recompiled, they didn't come back, and VS was behaving itself again.
I can't explain it, but it worked that time, and I offer it as an example of VS gremlins that seem to have rather irrational solutions.
Maybe it was just a strange planetary arrangement that did it, I guess I'll never know.

Related

Visual Studio solution explorer incorrectly identifies classes as custom controls

I have a project in Visual Studio which is misidentifying some of the files as 'user controls' as opposed to code-only classes. The project compiles and runs just fine, but it does leave a slightly annoying issue that when these files are double-clicked, the designer window is presented instead of the code editor.
Obviously, there are plenty of ways to get to the editor but, firstly it's annoying, and secondly, I don't know if this could lead to other issues later down the road so I'd like to resolve the problem sooner rather than later.
As you can see from the screenshot, there are 5 files, all of which are code-only classes, yet 4 of them are identified as custom-controls by the solutions explorer; only the final one is identified correctly.

Fields in the XAML editor Property window becoming un-responsive

Edit: I see "Silverlight -" is in front of my question, which I realize may have something to do with the alphabetical order of my tabs... really Visual Studio 2013 should be in front, anyone know if that can be changed?
I've been using the newer Visual Studio 2013 for about a week now, and I've found some quirks with it. The one that seems to happen the most is when I'm in the XAML editor working on something, suddenly if I go over to the property window I can't enter anything. I'm not running/debugging. I can type stuff in the regular XAML code editor window.
Even stranger, one of the times, I could get the cursors to appear in the fields. I typed a bunch of junk and just one character from what I types appeared. Another time I couldn't enter values into the properties, but I could double click on an event in the events window and create a new event handler. Just a minute ago I had the opposite, where I couldn't double click in the events window.
I think VS 2013 introduced async handling of more things, could it be related to that? Or perhaps because I'm using Silverlight? Right now my only workaround is to restart VS, does anyone have any knowledge about this? Anyone else experienced this?
I'm going to submit a bug report, but it would be a while before there's a patch, so I'm wondering if maybe someone understand the problem better and has a workaround? Or maybe just confirm that this exists and that I'm not crazy/my computer's haunted.
Edit:
I should mention another weird thing that happened two nights ago. I thought it was some how my doing, but I never figured out how I could have managed it without noticing. I was working on a piece of code, went to run after changing a few lines, and suddenly I had a ton of compiler errors. I go over to a user control I haven't touched in hours and suddenly the main LayoutRoot grid is completely empty. Luckily I'd committed to source control, but still...
I found an easy way to deal with this problem. It happens a lot after debugging so what I did was I created a batch file on my desktop containing this line taskkill /f /im XDesProc.exe and I run it every time the properties start misbehaving. Its the quickest way to reload the designer's functionality. I submitted this bug to microsoft they claim it will be included in the next update.
Me and another guy are developing a silverlight app and having the same exact problem. I accidentally found where the bug lies and how to mess with it to allow you to type "very briefly". Apparently this has something to do with tooltips. If you hover over anything in the property window when this bug is happening and allow a tooltip to popup while your cursor is blinking in a field, for the duration that the tooltip is up you can resume typing normal. As soon as the tooltip times out and disappears you can't type. So the only way you can edit or search properties is while a mouse tooltip is floating active. Very unusual. Can't seem to find any kind of tooltip settings in the program and the situation is very hard to find on google because search results assume your talking about programming tooltips. As far as I know we have had this issue since before release candidate. We are currently on official update 1 with the same problem persisting.

VS 2010 C# Express - Intellisense not showing all options

I am having a strange problem with IntelliSense in Visual Studio 2010 C# Express Edition: when it pops up to show me the list of suggestions, the list is missing valid options.
For example, say I want to add a "KeyDown" event handler to a control, I start typing "someControl.K<Ctrl+Space>", but the popup doesn't list the KeyDown event; actually, it does not contain anything starting with a K (not KeyPress or KeyUp either).
This is not so bad, since simply typing "KeyDown" by hand won't kill me, but it is highly irritating, especially when I am dealing with objects whose members I am not familiar with.
After all, one of the uses of IntelliSense is giving you a quick overview of what Methods/Properties/Fields/etc. the object has to offer - but if it leaves out some of them semi-randomly, that point is rather moot.
(By semi-randomly I mean that, while there does not seem to be any discernable pattern for which members are left out, at least it is consistent in that it is apparently always the same ones that are missing.)
Does anyone have any idea what might be causing this phenomenon? A corrupt IntelliSense cache? Is there a way to purge that cache and force a rebuild?
You could try to delete the .sdf and .suo files of your solution (after closing it) and then reopen it.
Also make sure that all Statement Completion options are checked and 'Hide advanced members' is unchecked (see picture).

Visual Studio designer stops recognising changes occasionally

Using VS2008 visual designer occasionally the designer seems to stop recognising changes. Normally you get a * next to the filename in the tabs when a change is made but sometimes this stops appearing when I am making changes. When this happens may changes are getting "lost" so if I close/reopen the file all my changes are gone.
Has anyone else encountered this and know why it happens and if there's a fix/workaround?
Cheers.
We ran into a similar problem in Visual Studio 2010. When attempting to resize a user control, the designer simply refused to recognize that a change was made (no * shown), and when you rebuilt, all source file changes were lost.
I found this link from another person having the same problem.
After stepping back through source control and comparing the .designer.cs file for the user control and its child controls, it turned out to be the same problem. At some point, the line:
this.components = new System.ComponentModel.Container();
disappeared from the designer file of one of the child controls (not the user control that I was having problems with). Incidentally, within that designer file, all of the references to "this.components" were also removed.
After fixing the child control (restoring the creation of this.components, and fixing the original references), the top level user control then started recognizing changes again.
We're not sure what caused the corruption of the child control. Perhaps it was a source code merge or a designer bug.
It's a very difficult problem to debug. Even if you attach a debugger to debug the design time behavior of the user control (and its children), there are no exceptions thrown and there is no indication that anything is wrong.

Why does my VB6 IDE loses its buttons and menu items?

I still have to use the VB6 IDE.
Unfortunately every time I start the IDE one of the buttons of the toolbar disappears. Almost always it's the Run button which goes first. Sometimes also items from the menu bar or the context menus are missing.
I have to reset the toolbars almost every time I start the IDE (Which is quite often during a typical work day). Recently I bought an IDE plugin which modifies the menu bar and requires a restart after every reset of the menu bar. (Otherwise it would crash)
I could live with just the resetting, but the restart is really annoying.
Is there something I can do?
To solve this problem:
Unload all add-ins.
Right-click on a toolbar and select the Customize... menu.
For each toolbar click the Reset... button (6 times in total).
Reload the add-ins.
For me action 3 was enough.
cf. MZTools faq (thanks to Andrea Bonafini), but these steps are originally from MSDN
It sounds like you recently bought a bad add-in. Can you get your money back? Every time I've had problems with disappearing controls in the IDE it has been due to a bad add-in. You can find out which one it is by disabling them, one by one, each time using the IDE for a while, then re-enable it and disable the next one, until the problem stops.
I still use one problematic add-in. It exhibits behavior similar to yours in that it makes the run button disappear. I avoid the problem by only loading the add-in when I need it, use it (it formats code), then I immediately unload it. If you don't use the functionality of the add-in that often, this could be an acceptable workaround.
Yea, i have this same problem with one of the add-in. But if you reset it. Shut the IDE down and open it back up again without doing anything, the IDE shouuld be able to retain the previous clean setup.
It's just guest, but:
Each graphical element on IDE (like button) is kind of resource (i.e. GDI handle).
Maybe your VB app doesn't manage these resources good enough and after sometime VB IDE cannot redraw elements like buttons (run is used often).
Also, maybe some IDE add-in is in conflict with some other add-in/application and breaks something -- I have this problem with Clip-X and MZ-Tools.
I had a similar problem when I was setting up the IDE to use for the first time, though it may not be helpful if you've been using the same IDE for a while. When I first started using the IDE, I would modify the toolbars and then close the IDE. When prompted if I wanted to save the open file I always said No, since the file was just a dummy file I was using to open the IDE with. Turns out the IDE was saving the toolbar preferences with that file, so they never got saved.
Try opening a file, customizing the UI, saving the file, then closing without modifying the code. This was the solution for me.
I've tracked down the problem and as suggested it was an add-in.
The problem went away as soon as I disabled the Visual Basic 6 Resource Editor.
How to restore your VB6 IDE without reinstalling:
Run Regedit
Find the entry for Visual Basic 6.0
Export your settings in case things
go wrong
Delete the 'UI' setting
Run VB and you will have your popup
menus back
The 'Find' button disappeared from my VB6 toolbar forcing me to select the Edit menu to use Find. I had two add-ins enabled: vbCodePrint and ResourceEditor; so I did away with both of them, turned VB6 off and back on, then put both add-ins back in and my button returned.
If you're still using the VB6 IDE, and I do amongst others, then this problem is not likely to have gone away. I use VB6 in Windows 10, and the problem is still there. But it doesn't affect me anymore.
I have had this problem a few years into using VB5 and VB6. Today, if I start VB6 directly, it may work fine the first time, but buttons will go missing the second time -- ALWAYS.
My solution, which I developed from day one:
Do whatever needs to be done to restore all your buttons. Save the Visual Basic 6.0 registry settings to a file, as suggested previously, and only keep the UI entry. Sometimes, you have to exit VB6 for it to post changes to the registry. So if this doesn't work the first time, try exiting before saving the settings.
I use my own program to launch VB6, which automatically copies my VB6 registry backup back into the registry -- by calling "RegEdit.exe /S D:\VB\IDE_Fix.reg" -- before I launch the IDE . This works every single time, and requires no action on my part.
If you read this, that means you are a programmer. You can make this work by yourself.
Mike
Reinstall,clean registry and update with SPacks etc....

Resources