Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We want to implement find text using WPF in c# , We tried with the indexing of the content but we are unable to find the content.

FileInfo is the richtextbox.

Kindly help us on this...

What I have tried:

int index = 0;
TextRange txt=new TextRange(
FileInfo.Document.ContentStart,
FileInfo.Document.ContentEnd
);
string temp = txt.Text;
FileInfo.Visibility = Visibility.Visible;
while (index < temp.LastIndexOf(FindOp.Text))
{
FileInfo.FindName(FindOp.Text);
FileInfo.Foreground = Brushes.Red;
index = temp.IndexOf(FindOp.Text, index) + 1;
}
Posted
Updated 21-Jan-19 3:12am
v2

1 solution

 
Share this answer
 
Comments
Member 14124816 22-Jan-19 3:05am    
Hi This code will work in winform but not for WPF (windows presentation foundation). We have already tried with this solution from our friend google.

Could you please help us with code which supports WPF controles

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900