Box containing all the controls has disappeared from my VB6 development environment - vb6

I'm using the VB6 development environment, and when I started it up this morning, the project displayed as usual, but the immediate box also appeared (even though the program was not running).
However, the box down the left-hand edge where one selects the controls to add to a form has also disappeared. Does anyone know what that box is officially called, so I can find it in the help text, or point me to the place to get it back again?
Edit: I restarted the VB6 environment again and now the properties panel at lower right has vanished.

As Alex K said, View, Toolbox for the control window, Properties/F4 for the properties window, etc.
If they keep disappearing randomly, it could indicate a corrupt value or even worse, general memory/disk corruption.
The values themselves are stored as a large BLOB under HKEY_CURRENT_USER\Software\Microsoft\Visual Basic\6.0\ in the UI and possibly the DockSDI values. You could try deleting these and see if it happens again.

There should also be an icon in your toolbar for displaying the toolbox.

Related

How to make Solution Explorer return to its previous state after clearing search?

I currently have a VS installation with no extensions to see how that works out. For navigation that means making heavy use of Ctrl+; aka Search Solution Explorer. While the search itself is ok, it has one major drawback for me that makes it a pain to use for me (both with keyboard and mouse):
Solution with two projects, one collapsed, one opened:
Use Ctrl+; and start typing until match found from collapsed project
What I want now is to simply clear the search and return to the previous view. Seems like a pretty standard requirement, no? But there seems to be no such functionality built in. Problem with the current commands that come close (pressing Esc, clicking Back or Home buttons in Solution Explorer Toolbar) is all the same: they have the extremely annoying behaviour that they insist on suddenly uncollapsing the previously collapsed project and track the match found! (Btw the Track Active Item in Solution Explorer option is turned of in the options). This makes no sense from a UX point of view? You select some kind of 'undo' command, the search box clears which is expected, but then suddenly there's an item visible from a previous search:
So if the collapsed project has like 50 items in it, solution explorer is now useless visually since it litters the screen with stuff you don't want to see, and worse you have to manually collapse the project again to return to the previous view.
Is there a way around this? I thought maybe keyboard shortcuts for Back/Home would be different, but the commands do not seem to be registered. I looked into EnvDTE80.DTE2.ToolWindows.SolutionExplorer but it has no properties/methods that have anything to do with this issue. And somewhere in the tree there is a Microsoft.VisualStudio.PlatformUI.SolutionPivotNavigator which is probably the class responsible for this behaviour, but I have no idea how to access it?
Recently updated to VS2013 SP3 and I have the impression there was a change (or I didn't notice this properly earlier, though my question says otherwise): if I use the Back button in the Solution Explorer view it properly takes me back to the previous view without expanding anything that wasn't expanded before. Using Esc or clearing the search box still behave the same which is a pitty, but at least if I remember to use just the back button it's workable.
update Not really an answer but since I started using Edit.NavigateTo (which is basically 'Go to Anything' including symbols/files) bound to a keyboard shortcut I found no reason to use Window.SolutionExplorerSearch anymore.

How does Windows keep track of application window layout, and how do I reset it?

I've just pulled a piece of code from the company git repo, and when I ran it for the first time, the layout of the components were awkward. I though the software was not working properly, then realized that the source code shows the window with that initial layout. This is a windows forms application written with C#, and my development machine is Windows 7
I've manually changed the layout through moving stuff around, and killed the debugging session. Now when I start the debugging/execution again, the window appears with the layout I've configured. I did not install this program or anything, but windows remembers the layout for this window, and I can't describe or demonstrate the initial layout to other members of the team. Cleaning the solution, rebuilding etc did not help. I can delete the local repo and do everything from scratch, but this is not a solution, just an annoying walkaround.
where is this information kept, and how do I reset it?
Ps: Searching for the solution through Google is another nightmare, since I can't think of keywords other than "windows layout history " etc...
It is not uncommon to write custom code to persist the layout of windows (position, size) and controls like splitpanels (or grid column size). This is usually done to present the last know layout to the end user. Windows doesn't offer a pre-built solution to this task because unintended consequences could arise (think about changing screen resolution and then restore a window to a now, out of screen position).
I am sure that it is your application that write/persist somewhere the information needed to restore its last 'layout'

How to stop Visual Studio from moving and/or resizing controls when opening a project?

I have a certain project that's been problematic in visual studio. The main form has a TabControl with four tab pages, and during initial development, the entire contents of the third tab page would shift down each time the project was opened. (It got really bad if you didn't look at that page for a few days, and the next time you ran the program, you had to scroll down past all the blank space that had built up before getting to any content.) That was relatively easy to work around by selecting everything and dragging it back up to the top.
Since the project has gone into maintenance/enhancement mode, the third tab page hasn't had any problems, but several controls on the fourth tab page are being re-sized (a small increase in width) or shifted left (a large decrease in X-position). Again, these same controls are affected each time the project is opened, so if you don't fix them each time, they'll continue to get further away from their correct settings.
The problem description is a lot like this other question; one notable difference is that the designer source file is not changed, i.e., I can open the designer source file in a separate text editor and see the correct values for location and position of all the affected controls, while at the same time I have the project open in Visual Studio and see the incorrect values in the Properties window. (Doing a "Save" or "Save All" doesn't affect the designer source file after just opening the project, but changing anything on the form and then saving it will make the source file match the incorrect values from Visual Studio.)
Any ideas about why Visual Studio is displaying the form incorrectly? I'd really like to avoid having to spend the extra time to fix it every day. And I'm not keen on adding code to the constructor to re-set those properties, as suggested elsewhere (violation of SPOT/DRY rule, you know--fraught with peril).
You can compare the Designer.vb file of the problem form from one version to the next. (Click Show All Files in Solution Explorer). That should tell you what is being changed and maybe you can find a workaround.
I've had similar problems that were resolved by uninstalling and reinstalling Visual Studio.
I finally found a way to get around this. When I set the affected form's Minimum Size property in the designer to something other than 0,0 (such as the current size of the form) some of the controls relocate themselves the next time I open the form. Setting Minimum Size back to 0,0 resolves it. The affected controls either have no Anchor setting or have Anchor set to Bottom.
So its seems the combination of Anchor Bottom and non-zero Minimum Size is what makes this unwanted movement happen.

VB6 - View Code will not display code

This is probably a really dumb question but i'll ask anyway.
I was wondering if there was any reason as to why a form wouldn't display its code when i click "view code" from the right click context menu in vb6?
It was working awhile ago so i'm kind of stumped.
Thanks
If forms are still not visible, try Window -> Cascade - This was the way I goit my forms visible again.
Maybe it is being displayed under something else. Check under the Window menu. Do you see it there?
Does the form display if you right click and select 'View Object'? If so, try double clicking on the form - that should display the source. You might also check the permissions to the file.
This is an old question, but since it's the first link retuned by a Google search, answering here may help many people.
Like someone else said, Window/Cascade does the trick, but with time it becomes annoying.
I have the same problem on my laptop with an external display. Closing the laptop cover (thus going back to only one display) fixes the issue.
An alternate way is to display the VB6 IDE on the main display (your main display is the one with icons on the bottom right corner). You can set your main display under System Preferences/Displays. There's a checkbox called "make this one the main display", it does not need to be your monitor #1.
Problem does not seem to occur if you have 2 displays side-by-side. Also, the fact that my laptop's resolution is not the same as the external display's resolution may cause the issue.
After taking these steps, you may have to restart the VB6 IDE to fix the issue.

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