Questions tagged [textrange]

Represents a selection of content between two TextPointer positions.

The TextRange class introduces the following terminology.

Selection - A TextRange is a selection of content between two positions indicated by TextPointers. One of these positions a fixed anchor with respect to the selection, while the other position is movable. This is similar to how a selection made by a user using the mouse or keyboard behaves.

Current Selection - Because a TextRange always indicates a selection in content, it makes sense to simply refer to the selection indicated by a TextRange as the current selection.

Text Container - A text container is the element that forms the ultimate border for the flow content at hand; the selection indicated by a TextRange always falls within a text container. Currently, a text container must be either a FlowDocument or a TextBlock. Document - The content collectively contained within a text container is referred to as a document. For more information about other related terms like position, see TextPointer.

92 questions
0
votes
1 answer

WPF equivalent to Windows Forms selection of length 0

I am redoing my Windows Forms app in WPF and I am having some trouble with the Selections of Windows Forms and the TextRange of WPF. In Windows Forms, I used to do a Selection of Length 0 on a RichTextBox to change the color of a specific position…
0
votes
2 answers

Change TextRange font color, but not the text that will be written next to it

I am using TextRanges in a WPF RichTextBox and I want to change the font color of a TextRange, but that if then it is written text next to it, it has the original color. For exmaple, I have a RichTextBox called richTextBox with font color black, and…
0
votes
1 answer

Is it possible to get text style for each words individually?

I know it is possible to get the text style of a selected word using getSelection().getTextRange().getTextStyle() but if I want to retrieve text styles from a previous slide word by word (getting each word's text style individually), is there a way…
0
votes
4 answers

javascript - multiple CreateTextRange simultaniously

I have the below javascript function, which when passed a word such as "Department" will highlight in red the first instance of "Department" found on the screen. However, i would like this code to highlight ALL instances of the given word. function…
Adam
  • 215
  • 2
  • 7
  • 14
0
votes
1 answer

How do I set a property to the last typed symbol in richtextbox in wpf?

I want to set some background or foreground properties to the latest symbol in RichTextBox. I tried getting the latest textrange by saving the caret position before the input and then getting the textrange like that: new TextRange(previousCaret,…
0
votes
0 answers

How to append a TextRange to flow document without losing formatting

I need to add the TextRange to flow document without losing formatting done to it in RichTextBox. I am getting RichTextBox.Text which converts it to string and lose all the formatting but I don't want to loose formatting of text read from…
Ali
  • 9
  • 4
0
votes
1 answer

TextRange.Find().Delete method is deleting leading/trailing spaces in a textbox

The text in the shape "TextBox 1" is "Work stack.<8Spaces>###Resource: Name1". I want to delete "###" from the above text using ppt vba. The text in the shape after the below statement gets executed is "Work stack. Resource:…
0
votes
1 answer

run time error -2147024809 (80070057) the specified value is out of range with shape

Here is my code, If ActiveWorkbook.Sheets("About tool").Range("G1").Value = 1 Then ActiveWorkbook.Sheets("About tool").Range("G1").Value = 0 With ActiveWorkbook.Sheets("About tool").Shapes("Rounded Rectangle 2").TextFrame2 If…
srt
  • 521
  • 3
  • 11
  • 22
0
votes
1 answer

Powerpoint VBA Remove carriage return from formatted text box

I am trying to remove a carriage return from a text box with formatted text: For i = ThisShape.TextFrame2.TextRange.Runs.Count To 1 Step -1 ThisText = ThisShape.TextFrame2.TextRange.Runs(i).Text ThisText = Replace(ThisText, Chr(13), "") …
Cymro
  • 1,201
  • 1
  • 11
  • 29
0
votes
1 answer

How to change an existing Tabstop in PowerPoint by VBA?

I have a VBA Code to resize objects in PowerPoint including Font size, margins and everything else. But I haven’t found a solution to update/change an existing TapStop. There is a the Ruler Object with different levels und a default value. I double…
Moe
  • 43
  • 5
0
votes
2 answers

jQuery is not detecting an Iframe

I am using the following code for Highlighting the text in the Iframe but i cant get it to work function getSelectedText() { if (window.getSelection) {; return window.getSelection().toString(); } else if…
Yahoo
  • 4,093
  • 17
  • 59
  • 85
0
votes
0 answers

WPF - Copying the content of a RichTextBox into a Paragraph

I'm currently trying to create a simple program in WPF to make cards for a custom card game. Some of the descriptions feature rich text (like bold and italics) to highlight important things. The effect and the flavor text are copied into the same…
0
votes
1 answer

Changing Spark TextArea text color dynamically over a range of characters

Hoping to obtain the help of some Flex 3/4 gurus out there... I am attempting to dynamically change the color of a subset/portion of text in a Spark TextArea control. Using the MX-based TextArea, I could leverage the…
Michael
  • 786
  • 8
  • 18
0
votes
0 answers

(C# WebBrowser) Why does "WebBrowser.Document" always returns null when reading PDF?

It doesn't matter if it is in WPF or Winform, because I tried both and the results were the same. I am making a PDF reader by using WebBrower. First of all, I added the reference and the directive "using mshtml". Then I loaded the PDf file like…
KaKaShi_CantAim
  • 37
  • 1
  • 12
0
votes
1 answer

WPF, C#, everytime the "Textrange.save"method can only save a ".text file" of 4096 bytes

These code seems worked before but I didn't have a backup, and now it comes with this problem that I really cant figure out why. Purpose : I would like to log all the serial port content received from a COM port, into a .text file (or other…
cmy
  • 1
  • 3