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

textrange losing textpointer reference?

I've been using some code I found here, to try and change the case of text in a flow document. It changes the text properly however all the formatting is lost (bold, italics, etc) and when I save the document to a XML file all the text ends up in…
0
votes
1 answer

How to reset TextRange for select only last selection in RichTextBox?

I'm working in wpf and visual basic. When I select text in RichTextBox i use TextRange: dim selection1 as New TextRange(Richtextbox.selection.start,Richtextbox.selection.end) Later: selection1.ApplyPropertyValue(ForegroundProperty,…
Inum
  • 53
  • 1
  • 7
0
votes
1 answer

How do you set the fill color of a TextRange?

In PowerPoint I have a TextRange object and I would like to set the fill color (not the font color). I know given a shape I can set via Fill.ForeColor, but what about for a TextRange object?
kimon
  • 2,481
  • 2
  • 23
  • 33
0
votes
2 answers

Textbox on a Drawing Canvas - Can't modify Textbox Text (Word VBA)

I having real trouble accessing textbox text via VBA if in a drawing canvas. Searching this + elsewhere show I should be able to access the text using "TextFrame.TextRange", but it fails, and debug shows no data present (I can't post an image as i'm…
0
votes
2 answers

Simulating "Increase Font Size" in PowerPoint VBA

In PowerPoint, if I've selected text with multiple sizes, I can hit the "Increase Font Size" or "Decrease Font Size" to have each TextRange grow/shrink by one "step" : I almost have a manual solution as follows: Sub GrowText(ByRef t_range as…
Felipe
  • 3,003
  • 2
  • 26
  • 44
0
votes
1 answer

Webbrowser find dialog for a text within an html element

I try to have the find dialog feature in my webbroser control, it should search several words (forward) and highlight them. I tried the following code from this MSDN question private bool FindFirst(string text) { IHTMLDocument2…
Ahmad
  • 8,811
  • 11
  • 76
  • 141
0
votes
1 answer

Formatting conflict for HTML table query in Excel

I would like to import some data from an online HTML table and place it in a spreadsheet that follows another formatting system. Let me explain. I am keeping track of a baseball team's results for a season, and more specifically hits, home runs and…
gmorissette
  • 291
  • 1
  • 3
  • 13
0
votes
1 answer

flex sprite textarea textrange

in flex,I have a textarea control i like to select some text in textarea. when mouse releases then selected text will be hilighted to GREEN RECTANGLE as sprite. can anybody help ??
msaif
  • 1
  • 1
0
votes
1 answer

Highlighting a phrase in a FlowDocument

I have a TextPointer tp pointing to the start of a phrase which I'd like to highlight using a TextRange. However this code: TextRange tr = new TextRange(tp, tp.GetPositionAtOffset(phrase.Length)); Debug.WriteLine("phrase:" + phrase + ", len=" +…
user317033
0
votes
1 answer

Mouseover event on colored with textrange object fragment of text

I want to ask question is it something possible with text range or other approach. I have a text. For example like this:
abcdefghij
I use text range to highlight fragment of text with yellow color. (I use example posted into…
Georgi Naumov
  • 4,160
  • 4
  • 40
  • 62
0
votes
0 answers

Highlight text range using JavaScript seems shifted

my question is related to this one: http://stackoverflow.com/questions/6240139/highlight-text-range-using-javascript I've used accepted answer from there, but highlight seems shifted a few points left. Here is my…
0
votes
1 answer

Applying different Font size to words in TextBox

Aim: To adjust Font size of group of words in a single textbox in PowerPoint. Details: I have two lists: Labels = ["Mahon Point Retail","Park","Blackpool Drive","Balance","Finglas Point"] FontSize = [10,23,15,20,40] I would like to apply the font…
Boosted_d16
  • 13,340
  • 35
  • 98
  • 158
0
votes
1 answer

Javascript text range up to caret position

I am using IE 8 and I would like to create a text range in a contenteditable div which should include all text until caret position (known to me in the editableDiv). So far I was able to select all text inside my the div: function…
Crista23
  • 3,203
  • 9
  • 47
  • 60
0
votes
1 answer

File extention for xaml package

I tried saving data from my rich text box using the TextRange to save in xamlpackage format, however my question is basic, what extension should the file have, if I use Xaml, the normal wpf xaml files would not be capable of opening as they are not…
surpavan
  • 1,372
  • 7
  • 34
  • 66
-1
votes
1 answer

How to track the selected text and mark it?

I need to know: with some of what position people select the text and add text around it full of tag with his class. Wherein: report should be based on HTML tags without such as span and link (a) Example:
serge
  • 391
  • 1
  • 3
  • 9