dstylesunf
Member
- Joined
- Jan 4, 2010
- Messages
- 6
- Programming Experience
- 10+
Simple question that I cannot find an answer to. How do I open a window created in wpf like you can with a winforms program? Example, form1.show would open a winform form with no problem. here is my code:
On the tick event I want to open the window Mainwindow and close the current window Window1
Thanks
VB.NET:
Imports System.Windows.Threading
Public Class Window1
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
Dim duration As Duration = New Duration(TimeSpan.FromSeconds(30))
Dim doubleanimation As Animation.DoubleAnimation = New Animation.DoubleAnimation(200.0, duration)
ProgressBar1.BeginAnimation(ProgressBar.ValueProperty, doubleanimation)
Dim dt As DispatcherTimer = New DispatcherTimer()
AddHandler dt.Tick, AddressOf dispatcherTimer_Tick
dt.Interval = New TimeSpan(0, 0, 15)
dt.Start()
End Sub
Public Sub dispatcherTimer_Tick(ByVal sender As Object, ByVal e As EventArgs)
'I want to open the window named MainWindow
Me.Close()
End Sub
End Class
On the tick event I want to open the window Mainwindow and close the current window Window1
Thanks