Results 1 to 10 of 10

Thread: [RESOLVED] 2nd form not showing on desktop

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Location
    UK
    Posts
    8

    Resolved [RESOLVED] 2nd form not showing on desktop

    I'm using VB on windows 10. I have an application that I wrote which has been working fine for a long time, and still works in the VS debugger, but when installed on the PC the forms (other than the form1) don't appear on the desktop any more. I have attached a screen grab. The main form shows a list of order/invoices. When one is clicked it should open another form with details, but the form never shows. Just an empty icon on the task bar. This used to work and one day stopped working.
    I have tried rebuilding and re-installing the app with no effect.
    Is Windows blocking it somehow because of a security update? How do I check that? I haven't seen any notifications pop up. Or what else could it be?
    Other application I have written and use on the same PC work fine!
    Attached Images Attached Images  

  2. #2
    Hyperactive Member
    Join Date
    Jul 2022
    Posts
    292

    Re: 2nd form not showing on desktop

    Which .net version is this using? I'm guessing maybe 4.8 given you state it has been "working fine for a long time".
    When you say it is installed on the PC, do you have an install script or are you copying the EXE and any support files to the PC?
    If you copy the EXE and support files to a folder on the development PC, does it operate as expected?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,537

    Re: 2nd form not showing on desktop

    It's probably something the form is doing. As you haven't told us anything about that beyond a vague general description, it could be anything.

    Try putting some tracing code in, i.e. something that tells you where the execution is up to and what data it's using that you'd normally use the debugger to see. You can even attach a debugger to the running process, if VS is installed on that machine.

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Location
    UK
    Posts
    8

    Re: 2nd form not showing on desktop

    Quote Originally Posted by jdelano View Post
    Which .net version is this using? I'm guessing maybe 4.8 given you state it has been "working fine for a long time".
    When you say it is installed on the PC, do you have an install script or are you copying the EXE and any support files to the PC?
    If you copy the EXE and support files to a folder on the development PC, does it operate as expected?
    The target framework is .NET version 4.7.2. The application was installed by published files for a CD, then run the setup.exe.
    Yes, if I copy the excutable or just run in from the obj folder, it works fine.
    So I wonder why it doesn't work when installed!

  5. #5
    Hyperactive Member
    Join Date
    Jul 2022
    Posts
    292

    Re: 2nd form not showing on desktop

    I'd do as jmcilhinney suggested and add some logging code, write to a text file where you attempt to display form2 and in the form2 load event.

    Are you using all the "normal" controls on this form? Any 3rd party controls at all?

  6. #6
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,781

    Re: 2nd form not showing on desktop

    Quote Originally Posted by ianr9000 View Post
    The target framework is .NET version 4.7.2. The application was installed by published files for a CD, then run the setup.exe.
    Yes, if I copy the excutable or just run in from the obj folder, it works fine.
    So I wonder why it doesn't work when installed!
    Are you manually positioning / remembering the location of the forms? I've done that and had the user remove monitors with a form on it.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  7. #7
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,545

    Re: 2nd form not showing on desktop

    Quote Originally Posted by dbasnett View Post
    Are you manually positioning / remembering the location of the forms? I've done that and had the user remove monitors with a form on it.
    I have an app, with an animated form that remembers its last location. I’ve had times when the compiled app config file has been corrupted and replaced with default values, resulting in the form being placed off screen. All I could do was manually edit the config file.

    BTW. John Wein should get off his horse and drink his milk
    I know what DoEvents does, and I use it, but very sparingly.

  8. #8

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Location
    UK
    Posts
    8

    Resolved Re: 2nd form not showing on desktop

    I am saving the form location to the user settings and I added some trace lines to write to a file and get this:
    load form start...
    form loc {X=-32000,Y=-32000}
    load form complete...


    I guess the form location could be the issue. But where is that saved?

    Update: I fixed it by adding a menu option to reset the form location back to {0, 0} and that has brought the form back on screen.

    Thanks everyone for your help
    Last edited by ianr9000; Mar 2nd, 2024 at 05:25 AM.

  9. #9
    Hyperactive Member
    Join Date
    Jul 2022
    Posts
    292

    Re: [RESOLVED] 2nd form not showing on desktop

    Excellent news, glad you were able to get it sorted out.

  10. #10
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,537

    Re: [RESOLVED] 2nd form not showing on desktop

    You should probably work out how this happened or it's likely to happen again. You still haven't shown us any relevant code so all we can do is guess. It might be that you're saving the location when the form is minimised or something like that.

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