Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: ChildWindow - How to pass a value from a childwindow to a main form

$
0
0
Hi,

You can use a binding to update the Text value :
<TextBox x:Name="txtResult"
                  Text="{Binding Text, ElementName=txtUserInput}"
                  BorderThickness="1"
                  BorderBrush="Black"
                  Height="20"
                  Margin="10" />
Or you can use the Closed event from ChildWindow to update the text :
<xctk:ChildWindow x:Name="_childWindow"
                              WindowBackground="#9A9999"
                              Caption="Modal ChildWindow"
                              IsModal="True"
                              Left="75"
                              Top="50"
                              Width="275"
                              Height="125"
                              WindowState="Open"
                              Closed="_childWindow_Closed_1">
               <TextBox x:Name="txtUserInput"
                        Text=""
                        BorderThickness="1"
                        BorderBrush="Black"
                        Height="20"
                        Margin="10" />
            </xctk:ChildWindow>


private void _childWindow_Closed_1( object sender, EventArgs e )
    {
      txtResult.Text = txtUserInput.Text;
    }

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>