Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by G Scott
at 2024-08-03 05:17:49
Point:500 Replies:2 POST_ID:828684USER_ID:11574
Topic:
Microsoft Visual Basic.Net;;
For a moment let's just pretend I know nothing about WPF. Let's say I have only started playing with WPF for about a week - for the sake of argument. Now, what's if I asked you what the WPF equivalent of this winforms code is:
My.forms.newForm.show()
My.forms.new.Form.TextBox1.Text = Me.TextBox1.Text
Me.Dispose()
We all know what that does. It takes whatever is in TextBox1 of the current form, opens the new form, and places that text into TextBox1 of the newForm. Simple. Really can't get any easier. I know this because I have been trying to do this exact thing in WPF.
Can someone please give me a clear sample of how you do this in WPF? I will not be offended if you talk to me as if I were a child :). Everything I read on this is usually in c#. Secondly, it's very convoluted with parameters and what not. Maybe it is that complex, but if I could be given a sample project that simply does this I think I would understand it better, but I have not found that link as of yet.
Thanks for any, and I mean ANY help on this.
My.forms.newForm.show()
My.forms.new.Form.TextBox1.Text = Me.TextBox1.Text
Me.Dispose()
We all know what that does. It takes whatever is in TextBox1 of the current form, opens the new form, and places that text into TextBox1 of the newForm. Simple. Really can't get any easier. I know this because I have been trying to do this exact thing in WPF.
Can someone please give me a clear sample of how you do this in WPF? I will not be offended if you talk to me as if I were a child :). Everything I read on this is usually in c#. Secondly, it's very convoluted with parameters and what not. Maybe it is that complex, but if I could be given a sample project that simply does this I think I would understand it better, but I have not found that link as of yet.
Thanks for any, and I mean ANY help on this.
Author: G Scott replied at 2024-08-03 08:08:25
I eventually got it. Thanks.
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
'Sending Form
Dim sForm As New Form2(TextBox1.Text, "Howdy", "Pardner")
sForm.Show()
Me.Close()
End Sub
'Public Sub New(sTEXT As String, text2 As String, text3 As String)
' 'Receiving FOrm
' InitializeComponent()
' TextBox1.Text = sTEXT
' TextBox2.Text = text2
' TextBox3.Text = text3
'End Sub
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
'Sending Form
Dim sForm As New Form2(TextBox1.Text, "Howdy", "Pardner")
sForm.Show()
Me.Close()
End Sub
'Public Sub New(sTEXT As String, text2 As String, text3 As String)
' 'Receiving FOrm
' InitializeComponent()
' TextBox1.Text = sTEXT
' TextBox2.Text = text2
' TextBox3.Text = text3
'End Sub
Accepted Solution
Expert: duncanb7 replied at 2024-08-03 05:50:31
500 points GOOD
http://www.codeproject.com/Articles/140611/WPF-Tutorial-Beginning
Take a look at this link, it might help you
Take a look at this link, it might help you