Here are the steps:
Step 1: Open a blank app and add two TextBlocks and a button either from the toolbox or by copying the following XAML code into your grid.
- <StackPanel Margin="10,40,0,0">
- <TextBlock Text="Type the word to find" ></TextBlock>
- <TextBox Name="textToFind" Width="200" Margin="0,10,0,0" HorizontalAlignment="Left"></TextBox>
- <TextBlock Text="Type or Copy and Paste a sentence to find from " Margin="0,10,0,0" ></TextBlock>
- <TextBox Name="sentence" Height="100" Width="300" HorizontalAlignment="Left" Margin="0,10,0,0" TextWrapping="Wrap"></TextBox>
- <Button Name="find" Content="Find" Height="40" Width="120" Click="find_Click" Margin="0,10,0,0" ></Button>
- <TextBlock Name="result" TextWrapping="Wrap" Width="300" HorizontalAlignment="Left"></TextBlock>
- </StackPanel>
Step 2: Add the following namespaces to your project which is needed in further C# code.