Announcement

Collapse
No announcement yet.

Loading fonts into Combo

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading fonts into Combo

    How would I go about loading all the fonts into a combo box?

    -------------
    Thank you,
    Ryan M. Cross
    Head Webmaster Nofee Inc. Internet Services
    President Likuid Creations Ltd.

    Thank you,
    Ryan M. Cross

  • #2
    This should get you started...

    Code:
    #COMPILE EXE 
    #DIM ALL
    #REGISTER NONE
     
    #INCLUDE "WIN32API.INC"
      
    CALLBACK FUNCTION MainCallback
        IF CBCTL = 100 THEN 
            DIALOG END CBHNDL, 0
        END IF
    END FUNCTION
     
    FUNCTION EnumFontsProc(pLogFont AS LOGFONT PTR, BYVAL pFontMetrics AS LONG, BYVAL dwFontType AS DWORD, BYVAL lNotUsed AS LONG) PRIVATE AS LONG
      
            DIM ghDlg    AS GLOBAL LONG
            DIM tLogFont AS LOCAL  LOGFONT
             
            tLogFont = @pLogFont
            COMBOBOX ADD ghDlg, 200, tLogFont.lfFaceName
            FUNCTION = 1
             
    END FUNCTION
     
     
    FUNCTION PBMain AS LONG
     
            DIM ghDlg AS GLOBAL LONG
            DIM hDC  AS LOCAL LONG
             
            DIALOG NEW 0,"FONTS",,,100,100, TO ghDlg
            CONTROL ADD BUTTON, ghDlg, 100, "Done", 25, 80, 50, 14
            CONTROL ADD COMBOBOX, ghDlg, 200,, 0,0, 100, 75
       
            DIALOG SHOW MODELESS ghDlg, CALL MainCallback
             
            hDC = GetDC(ghDlg)
            EnumFonts hDC, BYVAL 0, CODEPTR(EnumFontsProc), 0
            ReleaseDC ghDlg, hDC
     
            DIALOG SHOW MODAL ghDlg, CALL Maincallback
       
    END FUNCTION
    -- Eric
    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>



    [This message has been edited by Eric Pearson (edited March 02, 2000).]
    "Not my circus, not my monkeys."

    Comment


    • #3


      you can click on the "search" button at the top of the screen to search the bbs for keyword(s).

      --dave


      ------------------
      powerbasic support
      mailto:[email protected][email protected]</a>
      Home of the BASIC Gurus
      www.basicguru.com

      Comment

      Working...
      X