Results 1 to 11 of 11

Thread: Combobox with a font list with their style

  1. #1

    Thread Starter
    Addicted Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    128

    Combobox with a font list with their style

    Hi friends,

    I'm searching to build a list of system fonts (just the list I get resuls, even if not in alphabetic order), but I would have their rendering in the list instead of just their name.

    Like this :
    Name:  fontcombobox.png
Views: 116
Size:  8.7 KB

    I found some examples, but they are for VB.NET ou VS2008

    Thanks
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone)

  2. #2
    Hyperactive Member
    Join Date
    Jun 2016
    Location
    EspaСЃa
    Posts
    341

    Re: Combobox with a font list with their style

    try this
    Font_Select.zip

  3. #3
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    8,312

    Re: Combobox with a font list with their style

    invalid zip file
    Sam I am (as well as Confused at times).

  4. #4
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    3,302

    Re: Combobox with a font list with their style

    Pretty sure there's no way around having to owner draw it. You could likely use CBS_OWNERDRAWVARIABLE at least, rather than the other owner draw style, to draw individual items.

    You could get away with a slightly simpler method by blocking the regular dropdown and dropping down a ListView instead, where it's fairly easy to use NM_CUSTOMDRAW to set the font per-item. But that has it's own issues.

  5. #5
    Fanatic Member
    Join Date
    Jun 2015
    Posts
    712

    Re: Combobox with a font list with their style

    Not quite as fancy but gets the job done, form which lists all the fonts and shows a preview when you select one.

    https://github.com/dzzie/libs/blob/m...SelectFont.frm

    The combo box is the gold standard, but Its complex and didnt find one, so I just use this one. Simple anyway.
    Last edited by dz32; May 24th, 2022 at 07:30 PM.

  6. #6
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    577

    Re: Combobox with a font list with their style

    The Zip file in #2 opens ok with 7-Zip but not with Windows.

  7. #7
    Fanatic Member
    Join Date
    Aug 2020
    Posts
    796

    Re: Combobox with a font list with their style

    JFYI:

    VB6 Simple Virtual ComboBox (OwnerDrawn)

    VB6 Virtual (ownerdrawn) TileView-Ctl

    Also, in the source code provided by thread
    VB6 Threading-Examples using the vbRichClient5 ThreadHandler,
    there is an excellent Owner-Drawn Virtual-List Control: ucVList

    Maybe you can also try converting VB.NET code to VB6 code.

    Name:  VirtualCombo.png
Views: 63
Size:  15.1 KB
    Name:  ThreadedDirScan.jpg
Views: 62
Size:  59.8 KB
    Name:  TileView.png
Views: 62
Size:  129.8 KB
    Last edited by SearchingDataOnly; May 25th, 2022 at 04:32 AM.

  8. #8

    Thread Starter
    Addicted Member Couin's Avatar
    Join Date
    Dec 2020
    Posts
    128

    Re: Combobox with a font list with their style

    Hi friends,

    Thanks for your aswers.
    Also, I tried the yokesee's zip but looks not easy to customise, plus I need to programmatiocaly change the "Select" word, when I change the application language (Jingle Palette). I need also (it's true I didn't precised this in my first message) to programmaticaly select a value. I mean, if I previously set the "Courrier" font, when I re-open the app and going in the settings, the "Courrier" font has to be already selected. Also, all fonts are not listed , and no more fonts after Microsoft YaHei UI
    About dz32 frm file, I don't understand, when I add it to a text project, it appears in the Modules list instead of Forms list.
    Also, convert to VB.NET is not conceivable at all lol

    I made a workaround that changing the font a buttons directly when I change the selected font from the simple list, without having to close the Settings window.
    It's not a super workaround but better than nothing.

    Just have to fix a problem that I have when I order ASC the font list, some fonts disappear. Perhaps I will open a new thread about sorting arrays.

    Thanks
    1 Hour vinyl mix live on Eurodance90 each sunday 10:00 PM (French Timezone)

  9. #9
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    8,312

    Re: Combobox with a font list with their style

    Quote Originally Posted by Steve Grant View Post
    The Zip file in #2 opens ok with 7-Zip but not with Windows.

    I see.....
    Looks like what the OP is looking for....(???)
    Sam I am (as well as Confused at times).

  10. #10
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    8,312

    Re: Combobox with a font list with their style

    Sorry---I posted without refresh...I see OP already tried yokesee's suggestion.
    Sam I am (as well as Confused at times).

  11. #11
    Fanatic Member
    Join Date
    Jun 2015
    Posts
    712

    Re: Combobox with a font list with their style

    here it is in its own small project. (minus the color picker)
    Attached Files Attached Files

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