Results 1 to 11 of 11

Thread: [RESOLVED] Startup form issues :s

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Resolved [RESOLVED] Startup form issues :s

    Ok, what i'm trying to do it make my program have an auto update feature, which i already have implemented but i'm chaning the way my program starts so now i need to mix everything around.

    This is some information that you will need to try and understand my problem:
    My project uses a Splash Screen (frmSplash)
    My main form is 'frmMain'
    My download update form is 'frmDownloader'

    Now when my splash screen launches, it checks for updates. If there is an update is changes a public variable 'blnUpdate' to True.
    Then when 'frmMain' loads i have this little clause in the Form_Load event:
    Code:
    If blnUpdate = True Then
        frmDownloader.Show()
        Me.Hide()
        Exit Sub
    End If
    But for some reason frmMain still appears (so does frmDownloader).
    Any Ideas?
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Startup form issues :s

    You can't hide a form that hasn't been shown. You shouldn't even be creating the main form if you don't want to show it.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: Startup form issues :s

    Quote Originally Posted by jmcilhinney View Post
    You can't hide a form that hasn't been shown. You shouldn't even be creating the main form if you don't want to show it.
    Where can i prevent frmMain from showing then? As it's my startup form, when the splashscreen times out it automatically opens.
    I'm not quite sure where i have to intervene to show the downloader form.
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  4. #4
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Startup form issues :s

    You need to create a seperate .exe for your updater, otherwise your .exe will never be updated.
    Start your normal .exe and check for update. If update available, call the update.exe en close your .exe.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: Startup form issues :s

    Quote Originally Posted by Radjesh Klauke View Post
    You need to create a seperate .exe for your updater, otherwise your .exe will never be updated.
    Nah i don't directly update the .exe file. I do it a wierd way:
    1) Downloads an installer package.
    2) Runs installer package
    3) Closes my .exe
    4) Installer package finishes installing & opens updated .exe
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  6. #6
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Startup form issues :s

    It's not weird, but why so "complicated"?


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: Startup form issues :s

    Quote Originally Posted by Radjesh Klauke View Post
    It's not weird, but why so "complicated"?
    Mainly because the installer .exe it downloads is already compressed so i don't have to use other functions to decompress the file after i download it.
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  8. #8
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Startup form issues :s

    Okay.

    - you don't need a splash_screen;
    - check for update on the main form;
    - if update found open the frm_update;
    - download your update_installer;
    - if download complete execute the installer from the frm_update and close the app;

    - now the installer needs to take-over.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: Startup form issues :s

    I just want the splash screen to show before the program for shits n giggles.
    Is there any way around it?
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

  10. #10
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Startup form issues :s

    Don't create a splash-screen, but a standard form which does your thing and when it's done load the other.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Re: Startup form issues :s

    Yer fair enough, thanks for the help fellas
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

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