Font size problem
-
I am using CListBox(MFC Class) which have some strings added to it.I want to display different string in different font.Is this possible?How this could be done? regards,
priyank
If you need different strings within the same control to be shown using different drawing styles (or fonts), you will likely need to do an owner-drawn control. I have an article that custom draws in a Combo-Box, and there are others around as well, like for drawing font names in their respective fonts. They will likely translate well for what you have to do. Try searching on this site for "Owner draw", "Owner drawn", "owner-draw", etc. for more details. Stay away from "Custom Draw", because that generally only applies to the newer Win32 controls (i.e.
CListCtrl
but notCListBox
). Peace!-=- James
Please rate this message - let me know if I helped or not! * * *
If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFiles -
I am using CListBox(MFC Class) which have some strings added to it.I want to display different string in different font.Is this possible?How this could be done? regards,
priyank
Take a look in your documentation. If
CListBox::SetItemHeight (...)
exists... is because it will most probably be possibl to change sizes and fonts. Read about theLBS_OWNERDRAWVARIABLE
style as well. And if you want examples... take a look here[^]Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)