dcsimg
Results 1 to 8 of 8

Thread: VB6 IDE moving modules on Multiple Monitors after running

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Posts
    19

    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)
    Name:  VB6_IDE1.jpg
Views: 192
Size:  40.1 KB


    Then, after running the app, F5, and then going back to edit both modules have now moved to the left (see red arrows below)

    Name:  VB6_IDE2.jpg
Views: 169
Size:  35.0 KB

  2. #2

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Posts
    19

    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)?

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Posts
    19

    Re: VB6 IDE moving modules on Multiple Monitors after running

    See 40 second video below for more details?
    https://youtu.be/ntzElKWnkpU
    Last edited by ultimateNoob; Aug 1st, 2019 at 04:14 PM.

  4. #4
    Frenzied Member jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    1,600

    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?

  5. #5
    Frenzied Member wqweto's Avatar
    Join Date
    May 2011
    Posts
    1,975

    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>

  6. #6

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Posts
    19

    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.

  7. #7
    Fanatic Member
    Join Date
    Feb 2019
    Posts
    706

    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.

  8. #8
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    6,222

    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.
    Last edited by Elroy; Aug 3rd, 2019 at 11:07 AM.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width