Solved

Rotating through forms

Posted on 2007-11-22
6
232 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 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

16 Experts available now in Live!

Get 1:1 Help Now