How to highlight part of a text in a listview item?

Hi,
I have a listview item which contains only text. I want to highlight only part of the text and not the whole text content in the listview item. For example if i have "SomeText", I only want to Highlight "Some". How do i do this?
Thanks.

This code should give you some ideas:
<Window x:Class="TextBlockColors.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Width="525"
Height="350">
<Grid>
<TextBlock Name="myTextBlock"/>
</Grid>
</Window>
and code behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
namespace TextBlockColors
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
public MainWindow()
InitializeComponent();
myTextBlock.Inlines.Add(new Run("Some") { Background = Brushes.Yellow });
myTextBlock.Inlines.Add(new Bold(new Run("Text")));
Just run it to see what it does
You get some ideas and should be able to go from there. Good luck!
noorbakhsh حميد نوربخش

Similar Messages

  • How to highlight the whole row of a particular line item of sale

    How to highlight the whole row of a particular line item of sales order depending on condition?
    Please help its urgent..
    Looking forward your reply.
    Moderator message: please do more research before asking, show what you have done yourself when asking, do not flag posts as "urgent".
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Aug 9, 2011 9:30 AM

    Any ideas on what would cause this NOT to work? I added this row right after the table is created and populated and it is still not highlighted when I enter the form. The snippet of code that does this is:
    MyTableModel modelS = (MyTableModel)dataModel.get("S");
    jTable1 = new JTable(modelS);
    jTable1.setRowSelectionInterval(0,0);MyTableModel is this:
    class MyTableModel extends DefaultTableModel {
      public MyTableModel(Object[] columnNames, int numRows) {
        super(columnNames, numRows);
      public boolean isCellEditable(int row, int column) {
        if (TableKey == 'S') {
          if (column == 6) {
            return false;
        if (TableKey == 'O') {
          if (column == 0 || column == 4 || column == 5) {
            return false;
        if (TableKey == 'P') {
          return false;
      return true;
    }Can anyone help? Thanks.
    Allyson

  • How to highlight parts of slide and dim the background

    I'm trying to figure out a way of accomplishing the following. I've searched the forums but haven't turned up anything so if anyone has some advice I'd appreciate it.
    I have a slide with an image that I am trying to highlight certain areas of. The sequence of events I am trying to achieve is this:
    1) Slide appears with image in the center
    2) The image darkens, and a rectangular highlight appears, similar to using the crop tool in Preview.app
    3) The first highlight remains, and a second rectangular highlight appears
    I'd like to use this effect to call out specific areas of an image in a nicer way than simply drawing a rectangle around them.
    I can't figure out if this is possible. I can get to step 2 by constructing a shape with a hole in the middle and placing it over the first image, but I cannot then add a second highlight since the first shape is obstructing the area I want to expose in the second highlight. Any tips are greatly appreciated.

    I find that when using Keynote it helps to start the approach to an effect by concentrating on the visual appearance of the final effect, rather than starting in concrete term about specific techniques. In that way, it is more likely that I generate a non-obvious but easy way to create the effect, which might otherwise be difficult or impossible to achieve with Keynote's tools.
    All of this is a roundabout way to saying that the approach you outline, of covering part of the image, is not the easiest. The easiest approach is likely to cover the entire image you want to darken, and then at the same time build in the original undimmed image on top, masked so that only the relevant part shows. You can do this as many times as you like, and thus have multiple "highlight" sections on the same slide. The Keynote guides make it extremely easy to align the multiple images and then mask the relevant parts, so that they all look like a single image.
    This approach is very flexible, and allows all sorts of cool variants. For example, you can take an original colour image, then dissolve in on top of it the same image but with the saturation turned down so that it is black and white, and a third copy in the original colour but with everything masked except an area of interest. The resulting effect is that a colour image will appear to fade to black and white except for one highlighted region that remains in colour. This is a very nice subtle way to do highlighting in images
    Alternatively, you can also achieve what you want with your initial approach, if you use multiple slides. On the first slide, construct your masking image with the single hole, and do the appropriate build. On the second slide, construct a new mask with holes for both highlighted sections. Now, to make the second highlight appear, simply transition between the two slides. As long as the slides are otherwise identical, and the transition used is appropriate (such as dissolve, or even none), it will appear as if one slide has now acquired a second highlighted section.

  • How to highlight text in a screen grab?

    I did a screen grab from imdb (Internet Movie DataBase) off the Internet.  It's currently in .png format.
    I want to highlight part of the text in the text in this picture as if I were using a yellow highlighter marker.  I've tried everything I can think of but so far no dice.
    It seems that the thing to do is to choose Tools > Mark Up, but Mark Up is grayed out.
    I know this is possible because a guy I work with does it all the time.  But it's too late to call him, and he's fairly irrascible anyway.  And I know I did it once a while ago.
    Can someone help?  Thanks.

    I'd never used Grab before, so just did so. It's an awfully simple app, it seems - offers some capture controls the keyboard commands don't (such as timed and full window), but doesn't seem to be able to do anything other than capture an image. Its Preferences are bare-bones.
    I had to open my test image in Preview to make any annotations. That was easy - save the image in Grab to the desktop and name it, then a double-click of the file opened it in Preview.
    So, we're back to Preview.
    Don't understand why the annotation tools aren't available to you in Preview.
    Edit - -
    Just rebooted into Snow Leopard to do some testing. No matter what I tried, new screenshot using keyboard or Grab, fiddling with settings, I could not get Preview to not allow selecting the Rectangle tool.
    Only other thing I can think of - do a Get Info on the screenshot file, check the permsissions at the bottom of the Get Info window.

  • How to highlight Urdu Characters

    i write a code that search for a sub string and highlight it with html markup <b><b/>
            if(originalString.contains(searchString)){
                searchString=originalString.replaceAll(ctxt, "<b>"+searchString+"</b>");
                out.println(searchString);
            }it works well with English, but if i use URDU (similar to Arabic) it break
    [Please see it in image|http://9154459373931442381-a-1802744773732722657-s-sites.googlegroups.com/site/faswoongar/Home/porb.PNG]
    there red one shows the break and green show how it should be.
    Any suggestion or help would be greatly appreciated.

    I don't think this is a problem of String manipulation, but rather of HTML/Rendering.
    Many scripts render some characters differently based on other characters nearby (it also happens in latin scripts, but less noticably, see ligatures).
    The problem seems to be that when you separate the two characters (for example with a <b> tag), then the rendering engine won't know that it should use a ligature.
    Unfortunately I don't know how to highlight parts of the word in this case, you'll probably need to highlight the full word in this case.

  • F110 Text for payment line items.

    Hi,
    Can any one help in this regard. How will the system capture the Texts for payment line items, I require this for ACH payment.
    Suppose  I paying to a employees, there may be so many payments like for eg: Payroll, Gas Bill, Reg Salary, Ins Prem, etc. where should I configure this, inorder the system will pick the correct text so that it can be displayed in ACH layout.
    Can anyone provide a solution for this I need to complete the requirement for ACH.
    Thanks,

    Hi Biju
    I am not clear what you are expecting.  You can make these setting in the default note to payee (if you want to see what items you can enter in the note to payee, please see the structure FPAYP, FPAYH and FPAYHX)
    Thanks
    Ashok
    Assign points for useful answer

  • How to highlight a text in Pqges?

    Hi, does anyone knows how to highlight a text in Pages for iPad??

    If you would like to see this very basic function added to Pages for iOS in the future, let the good folks at Apple know of your needs:
    http://www.apple.com/feedback/

  • How can I control printing highlighted part of a page?

    I have a problem with a new computer on which I can not print highlighted part of a page. When I try the highlighted part is not printed. If I use my old computer the highlighted part is printed as expected. I have compared the settings for both the printer and Firefox on both computers, but do not see any difference. Both runs Win7, runs on the same network and use the same printer. Only difference I can think of is that the new is a 64 bit computer. Any ideas of how I can solve my problem?

    Hi 16tons,
    The issue you are referring to might be a known bug. You should look at CWW's post in this thread:
    https://support.mozilla.org/en-US/questions/923294
    A fix is planned for the next Firefox update.
    Hopefully this helps!

  • How Do highlight text in the body of an email message in Mac Mail?

    Can anyone tell if IF and HOW I can highlight text in the body of an email message using Mac Mail (in Yosemite).  I do NOT mean MARKUP an attachment.  I want to highlight a word or phrase in the body of my email message.  I know I can change the font color, but can't seem to add a highlight!  Thanks!

    Hi,
    is is possible, - link is below. Works on Yosemite, btw.
    http://www.mihalick.us/how-to-highlight-text-in-yellow-using-apple-mail/

  • How to select different parts of the text? cmd button no longer does that...

    After installing Maverics i can no longer propertly edit my work as I cannot mark different parts of text using cmd button. Shift works as before for highlighting all the text from starting point to selected point but I can no longer use cmd to highlight different areas of the text. Is this an OS bug? Or was the button for selecting different parts of the text changed? I tried everything...

    It's just a small part of what makes Pages 5 so "stunning" (Apple's word). You think stripping out the nifty ability to mark non-contiguous passages of text was neat? Sure that was nice. But Apple has gotten rid of more, so much more. And for free!
    Just wait till you put the product through its paces and you discover other nice features that are missing, such as (but not limited to):
    - no linking of text boxes!  Yes, that's right. Now a newsletter that had a "continued on page 6" or whatever will be broken by Pages 5. Stunning! (Even more stunning, Pages 5 will strip out all sorts of formatting from documents created with Pages 4.3 and it will do ao without warning and will save the document in a NEW unified file format so that it cannot be opened by Pages 4.3, thereby potentially losing users hours and hours of work. Stunning!
    There's more!
    - Pages 5 has no mail merge, no bookmarks, no images in headers/footers! Pages 4.3 has those features, but this stunning new release removes them.
    - Pages 5 features vastly reduced and simplified set of templates (there used to be about 130 Apple-cupplied templates, now there are about 60).
    - Page 5 also boasts NO RTF SUPPORT, so a paper your wrote with Apple's own TextEdit is not natively readable with Pages: Stunning!
    - No detail was too small to omit in this stunning new release: the vertical ruler, so you can easily place text or an obejct at a certain place in a document: gone! Setting the default zoom: gone!  Status bar reproting word count and pagecount (e.g., Page 4 of 48): Gone! View comments in the left side bar: Gone!  Autocapitalization: Gone! Search & Replace: drastically simplified!
    But here's the really good news: Pages 5 is just PERFECT for creating a one page-poster advertising a new concert by Apple employee Eddie Cue. What's more you can collaborate on it with someone else, even if they're using a PC. Now that's "stunning"!

  • How to highlight text in JTextField?

    Hi all, I know this is a very simple question but I just couldn't find its solution and I'm rushing for my project.
    My question is: how to highlight all the text in JTextField when it gets focus?
    Thanks a lot in advance!
    Janet

    You have to add a FocusListener in the JTextField and override the focusGained() method to select all the text with JTextField.selectAll().
    class MyFrame {
      JTextField text = new JTextField();
      // when creating the frame
      text.addFocusListener(new FocusAdapter() {
        public void focusGained(FocusEvent e) {
          doSelectAllText(); 
      void doSelectAllText() {
        text.selectAll();
    }Hope this help.

  • How to highlight text in the iCloud web app

    Hi,
    My computer recently broke so I had to use my mom's windows computer to do my homework. I had to use the iCloud web app Pages to do my homework. My assignment requires to be able to highlight stuff so does anyone know how to highlight text in the iCloud web apps?

    You can do this easily by using a "modify class" parameter in your web template.
    Following methods are of your interest to change char/KF headers.
    CAPTION_CELL          changes formats/values of characteristic headers
    STRUCTURE_CELL          changes formats/values of key figure headers
    Hope it helps.
    Hari Immadi
    http://immadi.com
    SEM BW Analyst

  • How can i turn a part of a text of  a JTextArea into bold??

    how can i turn a part of a text of a JTextArea into bold?? I mean i just want the selected text to do so and not all of the content of the JTextArea.
    Is there a way to do so??
    If not, is there another component that i can use to do so??
    [Rik]

    Use a JTextPane. Here's an example to get you started:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=342068

  • How do I get a link address to show highlighted in an email text so people can just click on it?

    how do I get a link address to show highlighted in an email text so people can just click it?

    madiandmo wrote:
    This is the deal.  I'm new to having a Mac & using Hotmail via Safari.  When I had a pc I the web browser I used with explorer.  Could it have anything to do with that? 
    no, the link was created for me via Acteva. 
    And, it is not longer than 69 characters. 
    Have you clicked on the link to ensure that it works?

  • IOS 8.2, iphone 6, how can i delete part of a text.

    I have pressed down on the part of the text I want to delete, the circle comes up to the left of the text, I highlight it, but the trash can will not appear at the bottom of the screen.  Delete all appears top left, but if I choose it, the entire conversation is deleted, not just the portion checked.

    What are you seeing in the corner? Do you possibly see a camera icon? Either way, some have reported this glitch. Do a reset on your device. It will not affect your data. Hold the sleep/wake and home buttons together until you see the Apple logo and then release. The iPhone will reboot. Try to delete after that. If you still have a problem, then double tap on the home button to bring up the multi-tasking bar. Swipe upwards on the Messages app and then do the Reset.

Maybe you are looking for

  • A CRY OF Help..To All Java Programmer

    Iam desperate please help....I Have to finish this code until tommorrow...i have done some and its running but it doesnt show the right computation... Prob: Mail order house sells 5 different product..prod1-$2.98, prod2-$4.50, prod3- $9.98, prod4- $4

  • How do I make my waveform send one point per iteration in a loop?

    Hello, I am trying to create a demonstration/lab for a future course at my university.  I am trying to send data from a wind turbine to a third party DAC in order to run a motor.  I have found out that when I send a wave form to the DAC I must send o

  • IronPort ESA 170 Upgrade Failed

    Hi All, We have just got two IronPort ESA 170 appliances delivered. I started off with upgrading the firmware from version 7.5.2-101 to 7.6.3-019. One of the appliances got upgraded fine. However, I am getting an error on the other one. Exactly when

  • Status 64 "No filters , No conversion .."  when receipt an Inbound Idoc

    Hi expert, I transfers an idoc from client 200 to client 700. At client 200 the outbound idoc is transfer ok but on client 700 when receipt inbound idoc I have status 64 "No filters , No conversion , No version change ." I have writen a FM to process

  • How to move entire catalog and collection from old PC with PSE 4 to new PC with PSE 9

    I have read various answers regarding upgrading to new PC's using newer versions of PSE . All solutions seem to differ slightly. Can anyone give me a good path to follow for upgrading from PSE 4 on old windows XP PC to PSE 9 on a new Win 7 PC Any hel