Solved

Rotating through forms

Posted on 2007-11-22
6
239 Views
Last Modified: 2012-05-05
Hello

I've created a basic application that rotates through 10 different forms, after the application reach's the last form it should keep rotating until the main menu button is pressed. After one complete cycle it appears to stop rotating. Do I need to reset the timer or something?

Thanks
0
Comment
Question by:eagles396
  • 3
  • 2
6 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20336495
how do you rotate through forms?
0
 

Author Comment

by:eagles396
ID: 20336546
Add Timer control to each form.

Set enabled to True
Set interval to 5000




Add the following code to Form 1
 

Private Sub Timer1(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
 

Form2.Show()
 

End Sub
 

Add the following code to Form 2
 
 

  Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
 

Form1.Close()
 

End Sub

Open in new window

0
 

Author Comment

by:eagles396
ID: 20336553
Sorry, code for form1 should read:


 

Private Sub Timer(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick

 

Form2.Show()

 

End Sub

 

Open in new window

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20336662
it is a strange code. Better you can switch between forms from the outside. That is, you can display forms inside a frame form, then you can put the timer on the frame form and switch indefinitely.
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 100 total points
ID: 20336942
Just close the current form immediately after you open the next one:

    Private Sub Timer(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick
        Timer1.Stop()
        Form2.Show()
        Me.Close()
    End Sub

To keep the app from closing:

    Click on Project --> Properties.
    Then on the Application Tab (selected by default)...
    Change the "Shutdown Mode" dropdown to "When last form closes"
0
 

Author Comment

by:eagles396
ID: 20345502
Thanks for your help.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now