Results 1 to 3 of 3

Thread: Text in two colors in the same item of one ListView

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    2

    Text in two colors in the same item of one ListView

    I have a Listview control in my app that has one item. I would like to be able to show text in this item with two colors? For example,

    Item data = COMMAND HIC, i want it see so COMMAND HIC

    Is this possible?

    Thanks for your support!!
    Last edited by psdos; Nov 29th, 2014 at 11:10 AM.

  2. #2
    PowerPoster
    Join Date
    Sep 2006
    Location
    Egypt
    Posts
    2,580

    Re: Text in two colors in the same item of one ListView

    You cannot if COMMAND & HIC are in the same column, but if they are in different column then try

    Code:
            Dim lvi As ListViewItem
    
            lvi = ListView1.Items.Add(New ListViewItem({"COMMAND", "HIC"}))
            lvi.UseItemStyleForSubItems = False
            lvi.SubItems(0).ForeColor = Color.Red
            lvi.SubItems(1).ForeColor = Color.Green
    Last edited by 4x2y; Nov 29th, 2014 at 05:43 PM.



  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2013
    Posts
    2

    Re: Text in two colors in the same item of one ListView

    Thanks 4x2y, finaly i add new column.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width