Now we will create a WPF that displays the reverse text of the originally entered text.
First choose Open Visual Studio, then File-> New-> Project, select the Visual C # template in the project and then select WPF App (.NET Framework), then set the name of the file name/app, if you want to change the directory Change the destination folder you want.
Then from the toolbox select text blocks, textboxes, and button and then drag it on the main screen.
Then, change the properties of the text blocks, textboxes and the button from the properties window.
The XAML code for the application is as follows,
- <Window x:Class="Reverse_of_entered_string_using_WPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Reverse_of_entered_string_using_WPF" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525">
- <Grid>
- <TextBlock x:Name="tbname" HorizontalAlignment="Left" Height="35" Margin="138,10,0,0" TextWrapping="Wrap" Text="Reverse of entered text" VerticalAlignment="Top" Width="244" FontSize="20" />
- <TextBlock x:Name="tbltext" HorizontalAlignment="Left" Height="21" Margin="137,63,0,0" TextWrapping="Wrap" Text="Enter text:" VerticalAlignment="Top" Width="122" FontSize="14" />
- <TextBlock x:Name="tblres" HorizontalAlignment="Left" Height="24" Margin="138,107,0,0" TextWrapping="Wrap" Text="Result is:" VerticalAlignment="Top" Width="121" FontSize="14" />
- <TextBox x:Name="txtdata" HorizontalAlignment="Left" Height="21" Margin="264,63,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="118" FontSize="14" />
- <TextBox x:Name="txtres" HorizontalAlignment="Left" Height="24" Margin="264,107,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="118" FontSize="14" />
- <Button x:Name="btnrev" Content="Reverse text" HorizontalAlignment="Left" Height="33" Margin="186,148,0,0" VerticalAlignment="Top" Width="106" FontSize="14" /> </Grid>
- </Window>

Gajendra JangidPosted Jan 31, 2018, 6:13 AM
Very help full .....
Sagar Pandurang KapPosted Jan 30, 2018, 2:43 AM
Very nice dude.Keep sharing..