Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Rotating through forms

Posted on 2007-11-22
6
Medium Priority
?
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 86

Accepted Solution

by:
Mike Tomlinson earned 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 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