How do I mark the entire contents of a RichTextBox (gRTbxInfo) with a background color of white?

How do I mark the entire contents of a RichTextBox (gRTbxInfo) with a background color of white?
I have code that finds / marks words with a different color.  Now I want to remove that color.  I've started with the following, but cannot complete it.
    //int iLength = gRTbxInfo.Length
    int iLength = 10;
    TextRange trText = new TextRange(gRTbxInfo.Document.ContentStart, gRTbxInfo.Document.ContentEnd);
    TextPointer tpStart = trText.Start.GetInsertionPosition(LogicalDirection.Forward);
    TextPointer tpSelectionStart = tpStart.GetPositionAtOffset(0, LogicalDirection.Forward);
    TextPointer tpSelectionEnd = tpSelectionStart.GetPositionAtOffset(iLength, LogicalDirection.Forward);
    TextRange tpSelection = new TextRange(tpSelectionStart, tpSelectionEnd);
    tpSelection.ApplyPropertyValue(TextElement.BackgroundProperty, new SolidColorBrush(Colors.White));
bhs67

Isn't that just
TextRange tr = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
tr.ApplyPropertyValue(TextElement.BackgroundProperty, Brushes.White);
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML

Similar Messages

  • How do I copy the entire contents of my laptops failing hard drive to copy back onto a new computer.

    How do I copy the entire contents of my laptops failing hard drive to copy back onto a new computer.

    If the drive has failed the only way to get any data off it is to send it to a Data Recovery company. Which is very expensive and no guaranty they will be able to retrieve any data.
    That is why Apple has included a system to backup your Mac on a regular basis, Time Machine. Also there are other Apps to do basically the same thing by Cloning your internal drive to an external drive. Carbon Copy Cloner and SuperDuper. Along with using Disk Utility to Image the internal drive to an external drive.
    Sorry to tell you but if the drive has really failed your Data is gone unless you pay a large sum of money to one of the Data recovery companies.

  • I am having trouble viewing the entire content of a PDF opened with adobe reader on my ipad.

    I am having trouble viewing the entire content of a PDF opened with adobe reader on my ipad. Mi am able to view the file in its entirety on my Mac but not on my ipad.  I have tried saving it to acrobat but that doesn't work either.  Any suggestions please.

    Hi,
    When you say the entire content, do you mean some parts of the pdf are not getting displayed or is it going out of the screen?
    Please send a pdf you are having issues with on chmaheshatadobedotcom, it will help us investigating the problem.
    -Charu

  • How do you copy the entire contents of a hard drive?

    Without all the permission issues and such? One example is when I try to copy my drive to an external firewire drive that's empty I get the can't copy a file cause one already exists. The drive is blank? I'm doing a quick reformat and it would be easiest to just copy the entire drive and pull files I need over later. It's a powerbook G4.
    Mac Pro Tower 2.0GHz   Mac OS X (10.4.9)  

    Hi
    Will Kappy's answer in this thread (link below) help?
    http://discussions.apple.com/thread.jspa?threadID=959886&tstart=0
    Steve

  • How do I "drag" the entire contents of a library onto Ipod (manual update)

    I can select the entire library to highlight it, but when I point on it with my mouse and try to drag it over, it's not working for me. I sometimes get the blockout symbol, but that's about it. HELP PLEASE!
    Much thanks.

    Forgive what may be a dumb question on my part, but do you have iTunes set to manage your iPod manually (which isn't possible for an iPod shuffle, if that's what you have)?

  • How do i clear the entire content of JPanel?

    when a certain event happens, how do i clear anything that is currently displayed in the JPanel?

    What do you mean by displayed? Something drawn on the JPanel? Or Components added to the JPanel?
    If the latter:
    myPanel.removeAll();
    myPanel.validate();Something like that. You may have to validate the content pane also/instead.
    If you want to clear the drawing, that would be slightly harder...
    Graphics g = myPanel.getGraphics();
    g.clearRect(0,0,myPanel.width(), myPanel.height());(I have no idea if that would work, but it sounds good).
    Cheers,
    Radish21

  • How do you print the entire contents from a data field?

    I have a simple Acrobat form that was sent to me and one of the data fields employs a scroll bar because it contains more text than the field can hold. How do I print my document so that it prints everything in that field, not just was is visible?
    Thanks

    I'm not sure you can do this with a standard Adobe Acrobat form. If the form is created with Acrobat Designer (Windows, not Mac product) there is the possibility to have the field grow in size. Designer based forms can be used on a Mac, but cannot  be created under the Mac OS (virtualization excluded).

  • How do I set the column content to automatic break lines

    Hello Guys,
    I have a problem with the column width and the column content of a standard report. Within the report are hugh entries which aren't interrupted by an space character. I set my column width to a special value by usingen "css style: display block; width: 300px;". Now the problem is that some of the column entries have a longer width than the column width is setted. So they overlock the entries of the column next to them.
    My question is: How do I set the column content to automatic break lines after a certain count of characters?
    After researching a couple of websites and discussion thread I found maybe a reference to the solution. I hope it help you to give me an answer.
    COLUMN LAST_NAME FORMAT A4
    regards
    wderr

    Wderr,
    PDFs are another animal entirely. Try adjusting the width of the column under the Print Attributes tab of the report.
    If that doesn't work you'll probably need to create custom XSL-FO layouts which, depending on the tools you have at your disposal, could take some time.
    Regards,
    Dan
    Blog: http://DanielMcGhan.us/
    Work: http://SkillBuilders.com/

  • Can I send the entire contents of a mailbox to another person as a .zip?

    I have a mailbox folder (MobileMe) that I specifically created in Snow Leopard Mail to segregate several hundred emails from the rest of my inbox. I would like to send the entire contents of this folder to someone via MobileMe - is this possible?
    In other words, how do I insure that someone else who is using Snow Leopard Mail will be able to view and open all the emails in the folder that I want to send to them (as if they were looking at the same folder on my own computer)?
    Is there a file somewhere in my user library that I can simply copy to a new folder, zip, upload to MobileMe, and send someone the download link to that will accomplish my goal?
    Many thanks!

    The mailbox you created in mail will be in your user account folder>Library>Mail>Mailboxes. You should see the MobileMe folder that you created in Mail.
    I'm not sure how it would work if you have attachments involved. If so, you will have a folder for attachments and messages. If so, maybe you would have to copy the whole mailbox.
    If it just has a Messages Folder, then all your messages are there. You can copy and send that.

  • How do i rotate the entire document?

    how do i rotate the entire document?

    There is no such thing. You will have to adjust the artboard and then manually rotate the content to fit.
    Mylenium

  • I recently created a new folder, dragged some items into it, and found that the entire contents of my desktop appeared to be in there as well. This happens every time I make a new folder. Any suggestions?

    I recently created a new folder on my MacBook, dragged some items into it, and found that the entire contents of my desktop appeared to be in the folder as well. This happens every time I make a new folder. Any suggestions?

    Csound1 What Ive been trying to explain is that I have been running bootcamp, I open the app where the first screen is the introduction, i hit continue, the first time I select "download the latest windows support software fromm Apple" then I return and instead select "Install Windows 7." Then hit continue. The third screen is where I "Create a Partition for Windows" I set Windows to 80 gigs then hit INSTALL. As stated before Bootcamp cannot find the install drivers saying "The installer disc could not be found." My windows software is on a USB drive not a disc, I tried using a virtual disc reader to make it appear that the windows software was running on a disc, still no luck. What I would like to know is how to install windows on bootcamp.

  • How do I upload the entire Edge Animate folder to the cloud?

    How do I upload the entire Edge Animate folder to the cloud?

    Hi there,
      Are you talking about the Creative Cloud? If so, you can compress the Edge Animate files into one folder as a .zip file, and then upload the entire .zip file by clicking the Upload button on Creative Cloud:
    I hope this helps! Let me know if you need further clarification! : )

  • Edu DVD in computer iTunes but does not show up in iPad iTunes or iPad video.  How do I make the DVD contents available on the iPad?

    Educational DVD added successfully to computer iTunes but does not show up in iPad iTunes or iPad video.  How do I make the DVD contents available on the iPad?

    Thanks!  For whatever bizarre reason for which I have no answer - I sync'd my iPad to my MBP the old fashion way (not iCloud) and the movie showed up just fine.  It is Nikon camera 'how to' video. I like to watch them for a better indepth discovery of what the camera can do.  The only weird thing about the hard wire sync is that it was placed in a catagory "home movies" which was never there before...actually it showed up in two places "home movies" and TV shows.
    So, thanks anyway!  Pretty cat!
    Mona

  • How do I select the entire text when the focus is moved to one TextBox?

    How do I select the entire text when the focus is moved to one TextBox?
    There are three TextBoxes.  I use <TextBox TabIndex="1"/> to set the order they are selected.  When I enter one specific TextBox, I would like to have the entire text selected ... one key stroke removes all of the text in that TextBox.
    bhs67

    I do it the following way:
    1.  Override the OnStartup for the application.  Use the following code: (VB.NET)
    EventManager.RegisterClassHandler(GetType(TextBox), TextBox.GotFocusEvent, New RoutedEventHandler(AddressOf TextBox_GotFocus))
    2.  In the event handler use this code (again VB.NET)
    Private Sub TextBox_GotFocus(ByVal sender As Object, ByVal e As RoutedEventArgs)
    _theTextBox = CType(sender, TextBox)
    If setFocusTimer IsNot Nothing Then
    RemoveHandler setFocusTimer.Tick, AddressOf setFocusTimer_Tick
    End If
    setFocusTimer = New DispatcherTimer
    setFocusTimer.Interval = TimeSpan.FromMilliseconds(10)
    AddHandler setFocusTimer.Tick, AddressOf setFocusTimer_Tick
    setFocusTimer.Start()
    End Sub
    Private Sub setFocusTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
    setFocusTimer.Stop()
    _theTextBox.SelectAll()
    End Sub
    What this does is register a handler for every textbox in your application.  This will execute when the GotFocus event is raised and will allow you to do whatever (in this case select all) you want.  A great way of handling things at the application
    level.
    Lloyd Sheen

  • I have a file where I store my download music. When I click on "add music" to my ipod my music file opens, but rather than have to drag one song at a time to my ipod, how do I copy the entire file at once to my ipod. - steve

    Hi - I have a file where I store my downloaded music. When I plug in my ipod and click on "add music" my file appears. Rather than drag one song at a time, how can I download the entire list at once? - steve

    I am not doing it in ITunes, but i did down load the song from ITunes.  I loaded the song on to my Nano, but in my menu selections it doesn't show the song or the artist in any search format.  However, when i plug in my nano to my PC I see the Nano library on my PC drive listings and that song and artist are there.  I can click on the song and it will play in Windows media on my work PC.  I did notice that the format for most all the songs in my library on my Nano are MPEG - 4 audio Files. 
    Thanks for your help, Mel

Maybe you are looking for