Results 1 to 6 of 6

Thread: Change Font of a ListView Item at Runtime

  1. #1

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168

    Question Change Font of a ListView Item at Runtime

    Please tell me

    Is it possible to change the Font or Font style (Bold/Italic etc.) at run time. If it is possible then please tell me how ?

    Thanks

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Sure , this way :

    VB Code:
    1. Dim fnt As New FontDialog()
    2. fnt.ShowDialog()
    3. Me.ListView1.Font = fnt.Font

  3. #3

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168
    Thanks Pirate


    Let me tell more:

    1. I want to change it programatically.
    2. I want to change font of only one item (not all)

    The functionality I want to give is, when user select a Item, the selected Item's font will change.

    Thanks

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Is this what you mean ?
    VB Code:
    1. Me.ListView1.Font = New System.Drawing.Font("Times New Roman", 10)

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    This would change font property for the first item in the listview collection items .
    VB Code:
    1. Me.ListView1.Items.Item(0).Font = New System.Drawing.Font("Times New Roman", 10)

  6. #6

    Thread Starter
    Addicted Member parminder's Avatar
    Join Date
    Apr 2003
    Location
    India
    Posts
    168

    Change Font of a ListView Item at Runtime (Solved)

    Thanks Pirate, its solved

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