Solved

Rotating through forms

Posted on 2007-11-22
6
244 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Regex validation 2 28
VB.NET - Error - Object not set in Module 4 41
vb.net class 3 22
Toolbar to format all windows forms controls at design time needed 5 16
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 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