Results 1 to 7 of 7

Thread: [RESOLVED] Form not displaying in IDE

  1. #1

    Thread Starter
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,149

    Resolved [RESOLVED] Form not displaying in IDE

    One for the books (???)....

    In one of my projects I have a form (shows up in the Project Explorer). Last time I modified that form was late 2020...I 'replaced' that form with another one (but it was only going to be temporary. So when I wrote code for the new form, I kept references in my code for the 'old' one as well. After adding the new form, I never SHOWED it, but did, with code, 'display' data on it (although it was never seen by the users as it was never SHOWED).

    Yesterday, I thought I would modify some of the controls on that old form with the intent to once again SHOW it during the run of my project. BUT, when I double-clicked on the name of the form (in the Project Explorer), it did not appear in the IDE.

    My 'solution' was relatively simple: remove the form from the Project and add it back in. Now when I double-click it I can see (and modify) it in the IDE.

    My question is: What happened to cause me to have to remove and add it, in order to see it in the IDE?
    Sam I am (as well as Confused at times).

  2. #2
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    9,871

    Re: Form not displaying in IDE

    My guess as to what happened is that this form had a top and/or left that was off your monitors (i.e., desktop area). And, when you removed/added it, the IDE forced it back onto a visible area of your desktop area.

    I'm often switching around to different monitor configurations (when traveling) with my laptop, and I'll often drag a screen to a second (or third) monitor. And then, when sitting at a different monitor configuration, I'll pull up one of those forms, and it'll be off the desktop area. My solution is just always to check top and left, setting them to zero if I need to.

    I can always still get the properties window (for setting top/left) even if I can't see the form.

    Good Luck,
    Elroy

    p.s. It's also extremely rare for me to not center a form (in form_load), so, I'll see it when running even if I don't see it while developing in the IDE. In some situations, I even check if a second monitor is available and center it there if it's available. But again, that's during runtime, and not while developing in the IDE.
    Last edited by Elroy; Jun 9th, 2021 at 08:11 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.

  3. #3

    Thread Starter
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,149

    Re: Form not displaying in IDE

    No Elroy...I checked all the properties of the form in the Project Explorer...left/right/ht/width, etc,. All were 'proper'---VERY similar to my 'replacement' form...That was the first thing I checked. (Before I removed the form from the project listing, I DID save it...but even then, it would not appear in the IDE until I removed it and added it back in.) And, yes, I have a second monitor on which I DO display these two forms when the project runs (I call them 'audience forms', as I either share that second screen with Zoom or use a projector for that second form/monitor). So, obviously, I checked that monitor when I double-clicked on the form in the explorer, but it did not show there (as my IDE is solely on the main monitor i use.

    SO, just curious what could have caused this anomaly.
    Sam I am (as well as Confused at times).

  4. #4

    Thread Starter
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,149

    Re: Form not displaying in IDE

    PS---I have about 8 forms (that show in the Project Explorer) that I use in the program...all of them showed up properly in the IDE except this one. Yes, fixed now, but curious. IDE bug?
    Sam I am (as well as Confused at times).

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Form not displaying in IDE

    Can't say I have ever experienced this. I do run the IDE in MDI mode and usually have the main and child windows maximized. Forms always appear top left corner of the window no matter what the settings within the actual form.

    As for your issue assuming you are running MDI mode the only thing I can think of is that somehow it got unlinked from the matching frx file but then I would expect that to throw an error when you try to load it. If you are running in SDI then that could be another matter completely as forms can be pretty much anywhere on the screen or off screen.

    I'm not sure as I have not used SDI mode in over 20 years but I seem to remember that the form would stay wherever you placed it and that may not be reflected in the forms properties. If so if you had dragged it off screen or onto another monitor it may appear not to show, removing and re-adding it would probably restore default placement.
    Last edited by DataMiser; Jun 9th, 2021 at 12:59 PM.

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Form not displaying in IDE

    The project's .VBW file is used to store the order, positions, and sizes of code, designer, etc. windows in the IDE.

    Moving a Form in code when it loads is sort of silly if you only want to center it in the monitor. Use the StartUpPosition property, assigned vbStartUpScreen at design time. Child dialog Forms should generally have vbStartUpOwner.

  7. #7

    Thread Starter
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,149

    Re: Form not displaying in IDE

    Yeah...I use the StartUpPosition almost always as "2-Center Screen", EXCEPT when I know I am going to be centering (and usually maximizing) the form on a second monitor (through code). I did not preview the associated .vbw file...guess that should have been my second step. More than likely, the .frm DID become unassociated with the .frx file...As these two forms have lots of images and other controls, I probably messed it up when I was creating (using copy-paste of the forms' contents) the new form.

    Anyway, I'll mark this as Resolved as I 'fixed it', as I said, by removing and adding...I was just wondering if anyone else had experienced something similar, and if so, had they identified the cause.

    I'm using MDI mode.
    Sam I am (as well as Confused at times).

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