Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I want to open a new form when my system watch reads the specified time entered in my data base and my project is minimised in taskbar.

Any kind of help will be highly appreciated...

Thanks
Sangaur
Posted

You can achive this by using Timer Control and Properties of Window Form
See this code :
VB
'Declare one Private Varialbe 
Private _TimeLimit As Integer = 0
'Ad this code on Form Load Event
Private Sub Form_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Form1.Load
    Timer1.Enabled = True
    Timer1.Interval = 100
    Timer1.Start()
End Sub
'Add this code on Timer Tick Event
 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        _TileLimit = _TimeLimit + 1  'Increasing value of _TimeLimit b 1
        If _TimeLimit = 100 Then WindowState = Minimized
        'When _TimeLimit Value is 100 Form gets Minimized.
 End Sub

Here i am taking variable for time you can read time from your DataBase using Ado.Net
I hope it will help you. :)
 
Share this answer
 
VB
Private Sub tmrSplash_Timer()

tmrSplash.Enabled = False
frmMain.Show
Unload Me

End Sub
 
Share this answer
 
Set up a timer with a suitable interval - depending on the accuracy you need, set it to about half that. So it you need it opened within a minute of the time you require, set the interval to 30 seconds (or 30000 in the Interval property.
Set a Tick event handler.
Start the timer.
When the tick event occurs, use DateTime.Now to see if it is time to display your new form. If not, ignore it.
When it is time, stop the timer, construct your new form, and use the Show method on the new instance.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900