2 Attachment(s)
VB6 IDE moving modules on Multiple Monitors after running
When I run my app then go back to edit-mode Forms and Code modules have moved to different locations, making it very difficult to stay organized.
Can anyone help with this issue?
The form and code modules are here (see red arrows below)
Attachment 170165
Then, after running the app, F5, and then going back to edit both modules have now moved to the left (see red arrows below)
Attachment 170167
Re: VB6 IDE moving modules on Multiple Monitors after running
To me, it seems that the IDE is not aware of the multiple monitors and thinks the modules are (off-screen)?
Re: VB6 IDE moving modules on Multiple Monitors after running
See 40 second video below for more details?
https://youtu.be/ntzElKWnkpU
Re: VB6 IDE moving modules on Multiple Monitors after running
It looks like you have extended the IDE across 2 monitors out of 4 total monitors. Does your program alter any display settings? If not, it may be that VB is not remembering the settings. Does this happen on all projects or just one?
Re: VB6 IDE moving modules on Multiple Monitors after running
Try switch the IDE to SDI mode in Tools->Options in Advanced tab.
This will take some getting used to it but AFAIK is the only option to keep sanity with the IDE on multi-monitor setups.
cheers,
</wqw>
Re: VB6 IDE moving modules on Multiple Monitors after running
It happens on all projects. Been dealing with this for years, tolerable but a bit irritating. Running the IDE in SDI remedies the problem but. . . well, you know, modules scattered all about.
Re: VB6 IDE moving modules on Multiple Monitors after running
You could make an Add-in that saves/restores window positions. You can use the Add-in mentioned here as a template. It's based on hidden events that tells you when the user just about to run a project and when it ends.
You would probably need to call EnumChildWindows, GetWindowRect, and SetWindowPos. Here is a VB6 sample for EnumChildWindows.
Re: VB6 IDE moving modules on Multiple Monitors after running
Yeah, I've never used the MDI mode (not even in the beginning), preferring to use the SDI mode.
However, the problem still exists when you use the SDI mode. And it can be particularly annoying for form designer windows. I do all my development on a high-end laptop, and I haul it around with me everywhere, frequently plugging in strange monitors at various client sites. Often I won't use the actual laptop's monitor, but sometimes I will. In other words, I'm constantly changing my monitors around.
Regarding my forms, I always center them in code (although, in some of these, I "remember" the last monitor they were on and center on that monitor, and not necessarily the primary monitor).
But, back to the IDE. When calling up the form designer windows, they're frequently off the screen. I've even written a little add-in to "Set Form with Focus to Left=0". I use that often.
Now, regarding other modules that get scattered into strange places, they usually have an "edge" showing which allows me to pull them back onto a visible monitor. But, even then, that's annoying. All of this non-Form location stuff is stored in the project's .VBW file. But that file isn't essential. To get things back to where they're easier to work with, I'm often just deleting that .VBW file, and starting over with the positions of various windows (where they just open to a default position on the primary monitor).
Maybe that'll help,
Elroy
EDIT1: Deleting the .VBW file when in MDI mode may also help. But you'd have to test that one.