Results 1 to 2 of 2

Thread: listview + font

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    14

    listview + font

    I have a listview with a checkbox and want to set the text to have a strikethrough if the checkbox is checked. How do you do this?

    Cheers
    Tim

  2. #2
    Lively Member
    Join Date
    Aug 2001
    Posts
    65
    This is how to set the parent and subitem text & colour properties.

    Code:
    'Add some color and bold some items in the listview
            'Row 1
            itmVar.BackColor = System.Drawing.Color.PaleGreen
            itmVar.ForeColor = System.Drawing.Color.Blue
            itmVar.Font = New Font("Tahoma", 9.0!, _
                            System.Drawing.FontStyle.Italic)
            itmVar.UseItemStyleForSubItems = False
            itmVar.SubItems(1).Font = New Font("Tahoma", 9.0!, _
                            System.Drawing.FontStyle.Bold)
            itmVar.SubItems(1).Font = New Font("Tahoma", 9.0!, _
                            System.Drawing.FontStyle.Italic)
            itmVar.SubItems(1).BackColor = System.Drawing.Color.Blue
            itmVar.SubItems(1).ForeColor = System.Drawing.Color.Yellow
            itmVar.SubItems(2).Font = New Font("Tahoma", 9.0!, _
                                    System.Drawing.FontStyle.Strikeout)
            itmVar.SubItems(2).BackColor = System.Drawing.Color.PaleGreen
            itmVar.SubItems(2).ForeColor = System.Drawing.Color.Blue
    I haven't tried to get or set them depending on what is selected from a checkbox.......yet, i'll try myself when i get the time.

    You may have to wait or try to organize it yourself. If you do post how you do it please.

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