Results 1 to 3 of 3

Thread: [2005] Help with Locking Application please

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    [2005] Help with Locking Application please

    Hello,

    I wonder if anyone can help me please ?

    I have a time on my app which counts down from a user specified number, then when it reaches zero, the application closes.

    This works fine.

    However, I'd like to change this so that instead of the app closing, it simply hides the main app and takes you back to the splash screen forcing you to log in again.

    The reason for this, is that if I log back in once the app has closed, I don't go back to exactly where I was - whereas if I simply hide the form, when I go back in I would.

    The process I use is :

    When the timer reaches zero.....
    1) Disable the time
    2) Hide the main form
    3) Create new instance of Splash Form
    4) Once the user logs in again, show the main form and enable the timer.

    and the code I'm using to accomplish this is :

    Code:
    IdleTimer1.Enabled = False
    FMain.Hide()
    Dim f2nd As New frmSplash
    f2nd.ShowDialog()
    FMain.Show()
    IdleTimer1.Enabled = True
    However, I've noticed a problem in that this will only hide the main form - if the user is in one of the other forms in the app, then this will not be hidden (The app isn't an MDI app)

    I actually need all open forms to be hidden once the timer reaches zero, then when the user logs back in, I need the same forms to be open as they were.

    Is this possible ?
    If so, can anyone shed any light on how I do it ?

    Thanks in advance.

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: [2005] Help with Locking Application please

    My.Application.OpenForms returns a collection of open forms. You just have to loop thru the collection and hide each one of them.

  3. #3

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: [2005] Help with Locking Application please

    Thanks stanav,

    I'll have a look into this - thanks for your help, I appreciate it.

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