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
    21

    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: 612
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: 417
Size:  35.0 KB

  2. #2

    Thread Starter
    Junior Member
    Join Date
    May 2016
    Posts
    21

    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
    21

    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
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

    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
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,120

    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
    21

    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
    9,853

    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. 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
  •  



Click Here to Expand Forum to Full Width