Click here to Skip to main content
15,889,216 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Xaml on the Web Pin
Jammer2-Feb-09 7:22
Jammer2-Feb-09 7:22 
GeneralRe: Xaml on the Web Pin
Pete O'Hanlon2-Feb-09 8:32
mvePete O'Hanlon2-Feb-09 8:32 
QuestionWPF ListView/ItemsControl Drag Drop Adorner Pin
snblackout29-Jan-09 18:40
snblackout29-Jan-09 18:40 
AnswerRe: WPF ListView/ItemsControl Drag Drop Adorner Pin
Pete O'Hanlon30-Jan-09 2:27
mvePete O'Hanlon30-Jan-09 2:27 
GeneralRe: WPF ListView/ItemsControl Drag Drop Adorner Pin
snblackout30-Jan-09 4:42
snblackout30-Jan-09 4:42 
GeneralRe: WPF ListView/ItemsControl Drag Drop Adorner Pin
snblackout30-Jan-09 5:33
snblackout30-Jan-09 5:33 
QuestionWPF RichTextBox is slow Pin
uncleashcan29-Jan-09 3:39
uncleashcan29-Jan-09 3:39 
GeneralRe: WPF RichTextBox is slow Pin
ejhuntington30-Jan-09 7:18
ejhuntington30-Jan-09 7:18 
I'm also attempting to high light text from regular expression matches using a wpf richtextbox. There seems to be 2 characters added to the start of the text in the richtextbox that is throwing off the match.index. However adding 2 to the index doesn't help in all cases. I'll post if I come up with a solution. Here is what I currently have.

private void applyRegex_Click(object sender, RoutedEventArgs e)
{
TextRange tr = new TextRange(this.testBox.Document.ContentStart, this.testBox.Document.ContentEnd);
this.testResults.Text += (tr.Text + "\n");
MatchCollection matches = CheckForRegexPatternMatches(findElementTagsRegex, tr);

if (matches.Count > 0)
{
foreach (Match match in matches)
{
if (match.Success)
{
this.testResults.Text += "SUCCESS\n";
this.testResults.Text += "Value:" + match.Value + "\n";
this.testResults.Text += "Offset: " + match.Index.ToString() + "\n";
this.testResults.Text += "Length:" + match.Length.ToString() + "\n";
this.testResults.Text += "Offset + Length: " + (match.Index + match.Length).ToString() + "\n";

TextRange matchRange = null;

//if (match.Index == 0)
//{
// matchRange = new TextRange(tr.Start.GetPositionAtOffset(match.Index), tr.Start.GetPositionAtOffset(match.Index + match.Length));
//}
//else
//{
// matchRange = new TextRange(tr.Start.GetPositionAtOffset(match.Index + 2), tr.Start.GetPositionAtOffset(match.Index + 2 + match.Length));
//}

matchRange =
new TextRange(this.testBox.Document.ContentStart.GetPositionAtOffset(match.Index),
this.testBox.Document.ContentStart.GetPositionAtOffset(match.Index + match.Length));

matchRange.ApplyPropertyValue(TextElement.ForegroundProperty, new SolidColorBrush(Colors.Red));
}
}
}

this.testBox.CaretPosition = tr.End;
}
QuestionDeep Zoom - Generate on Demand/Dynamically Pin
Dominic Pettifer28-Jan-09 14:46
Dominic Pettifer28-Jan-09 14:46 
AnswerRe: Deep Zoom - Generate on Demand/Dynamically Pin
ColinM12328-Jan-09 16:59
ColinM12328-Jan-09 16:59 
AnswerRe: Deep Zoom - Generate on Demand/Dynamically Pin
Mark Salsbery29-Jan-09 5:39
Mark Salsbery29-Jan-09 5:39 
QuestionAdding dynamically new lines and columns to a grid ? Pin
WolveFred228-Jan-09 4:20
WolveFred228-Jan-09 4:20 
AnswerRe: Adding dynamically new lines and columns to a grid ? Pin
ColinM12328-Jan-09 13:45
ColinM12328-Jan-09 13:45 
GeneralRe: Adding dynamically new lines and columns to a grid ? Pin
WolveFred229-Jan-09 2:41
WolveFred229-Jan-09 2:41 
GeneralRe: Adding dynamically new lines and columns to a grid ? [modified] Pin
Mark Salsbery29-Jan-09 5:46
Mark Salsbery29-Jan-09 5:46 
GeneralRe: Adding dynamically new lines and columns to a grid ? Pin
WolveFred229-Jan-09 7:37
WolveFred229-Jan-09 7:37 
GeneralRe: Adding dynamically new lines and columns to a grid ? Pin
Mark Salsbery29-Jan-09 7:52
Mark Salsbery29-Jan-09 7:52 
GeneralRe: Adding dynamically new lines and columns to a grid ? Pin
WolveFred229-Jan-09 8:04
WolveFred229-Jan-09 8:04 
GeneralRe: Adding dynamically new lines and columns to a grid ? Pin
Mark Salsbery29-Jan-09 9:15
Mark Salsbery29-Jan-09 9:15 
GeneralRe: Adding dynamically new lines and columns to a grid ? [modified] Pin
WolveFred22-Feb-09 4:37
WolveFred22-Feb-09 4:37 
GeneralRe: Adding dynamically new lines and columns to a grid ? Pin
Mark Salsbery2-Feb-09 5:55
Mark Salsbery2-Feb-09 5:55 
GeneralRe: Adding dynamically new lines and columns to a grid ? Pin
WolveFred23-Feb-09 3:31
WolveFred23-Feb-09 3:31 
QuestionFit to Screen in WPF [modified] Pin
AnkitSingh28-Jan-09 4:00
AnkitSingh28-Jan-09 4:00 
AnswerRe: Fit to Screen in WPF Pin
BlitzPackage28-Jan-09 13:50
BlitzPackage28-Jan-09 13:50 
AnswerRe: Fit to Screen in WPF Pin
raihansazal31-Jan-09 20:18
raihansazal31-Jan-09 20:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.