-
Sep 12th, 2010, 04:49 PM
#1
Thread Starter
New Member
New to WPF
I have been programming in VB6 for quite a while and moving to VB 2010 and WPF and have a couple of questions that need an answer to. 1) In VB6 I could reference a textbox on Form1 in Form2 to get the value from it, but don't see how to do this in WPF. I am actually using Windows in WPF instead of Forms. 2) I also need to know how to go from Form1 to Form2 and thn back to Form1. The only way I can see to load Form2 is to Dim Form2 as New Form2 and then Form2.Show. If I were to do this to get back to Form1, that would create a new instance of the form instead of taking me back to the one that is already open.
Any help will be greatly appreciated!
Charles
-
Sep 14th, 2010, 02:22 AM
#2
Re: New to WPF
1. You're not using Windows instead of Forms. WPF doesn't have Forms. A WPF Window is the equivalent of a Form from Windows Forms or what was used in VB6. If you're using WPF then you're using Windows, plain and simple.
In Windows Forms you have two ways to access the default instance of a Form. You can use the long-hand:or the short-hand:In WPF you only have the long-hand:
vb.net Code:
My.Windows.SomeWindow.Show()
2. If you call Show on a Window then it returns immediately. If you call ShowDialog then it will block until the dialogue is closed.
-
Sep 15th, 2010, 05:45 AM
#3
Re: New to WPF
If I were to do this to get back to Form1, that would create a new instance of the form instead of taking me back to the one that is already open.
Sounds like you simply want to close the second window, which you do by just doing this from the second window:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|