Question Some questions in WPF application

kevinlin

New member
Joined
Apr 20, 2009
Messages
1
Programming Experience
Beginner
Good morning, guys, Now I'm using WPF application to do my project and I face some problems. One is when I press a button, a button click event will cause a window to come out, but my problem is when the button is pressed, the window I supposed it to come out appear twice. The code I wrote for this event is like below:

Private Sub btnSwitch_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles btnSwitch.Click
Dim b As New Switch
b.Show()
Me.Close()
End Sub

Another question is : Every time when the application runs, a window will come out, but it appear in random position, so my question is how can I give it a fixed position so that it can appear in the same position after the application runs?
I knew in windows form application I can set the position property of that window, but in the WPF application the window doesn't have a position property.

Thank you very much for your kind help.
 
Back
Top