CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    Font in a ListView

    I am tring to update the text's font size in a listview by the Properties (Font) or in the code
    (
    lvListView.Font.Size = 24
    lvListView.Font.Bold = True
    )
    and both of them are not working!
    how can i change the font size of the text within the ListView? any idea?
    Thanks
    Sigal


  2. #2
    Join Date
    Jul 1999
    Posts
    24

    Re: Font in a ListView

    Ok, if you are handling with listboxes the methods are FontSize and FontBold not Font.size and Font.Bold. Try like that. I did it and it worked.

    Code:

    dim i as integer

    list1.fontsize = 24
    list1.fontbold = true

    for i = 0 to 10
    list1.additem "test", i
    next i

    Hope this helps

    Michael


  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: Font in a ListView

    funny, I tried that and it worked:


    l.Font.Bold = true
    l.Font.Size = 20
    Dim item as ListItem
    set item = l.ListItems.Add
    item.Text = "test"



    in vb6 sp3


  4. #4
    Join Date
    Jul 1999
    Location
    Israel
    Posts
    140

    Re: Font in a ListView

    Thanks but i am handling with ListView.


  5. #5
    Join Date
    Jun 1999
    Location
    Switzerland
    Posts
    58

    Re: Font in a ListView

    Hi,

    You can set Listview.font.bold = True (or False)
    ListView.font.Size = xyz
    ListView.font.Name = "Arial" (or whatever is available)




  6. #6
    Join Date
    Jul 1999
    Posts
    24

    Re: Font in a ListView

    Hello, again!

    Forgive me my lousy english.
    Sorry, I'm just a beginner. I didn't knew the difference. But, hey Thanks now I know. ListView is a view like in Windows NT explorers right side window am I right?


  7. #7
    Join Date
    May 1999
    Posts
    3,332

    Re: Font in a ListView

    Yes, you are right.


  8. #8
    Join Date
    Jul 1999
    Posts
    24

    Re: Font in a ListView

    Alright, maybe I someday learn How To Program Visual Basic. =)

    Michael


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

Featured