Results 1 to 3 of 3

Thread: Common Dialog: Selecting fonts as regular files

  1. #1

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Common Dialog: Selecting fonts as regular files

    I am having trouble attempting to use the Common Doialog control to select font files. It will not let me select them. I don't want it to treat the files as fonts but as regular files that can be selected. how can I do this?

    If I change my filter to use
    Code:
    F.CommonDialog1.Flags = cdlOFNHideReadOnly + cdlOFNPathMustExist + cdlOFNNoReadOnlyReturn + cdlOFNAllowMultiselect + cdlOFNLongNames + cdlOFNExplorer
    F.CommonDialog1.Filter = "Fonts |*.ttf"
    I cannot select the font files even though the control will show them. But if I change the filter to
    Code:
    F.CommonDialog1.Flags = cdlOFNHideReadOnly + cdlOFNPathMustExist + cdlOFNNoReadOnlyReturn + cdlOFNAllowMultiselect + cdlOFNLongNames + cdlOFNExplorer
    F.CommonDialog1.Filter = "Fonts |*.*"
    It still will not let me select the font files, but I can select any other type of file.
    Last edited by randem; Sep 13th, 2007 at 03:14 AM.

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Common Dialog selecting fonts as regular files

    As the Cd autoexecutes the font instead of getting the Font name, i think the easiest solution would be creating your own MsgBox, like..
    Code:
        Dim Str As String
    
        Str = Dir("C:\windows\fonts\*.*", vbNormal)
        While LenB(Str)
            List1.AddItem Str
            Str = Dir()
        Wend
    This example es too basic but i think you get what i meant.

  3. #3

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Common Dialog selecting fonts as regular files

    Yeah, I was trying to avoid that... Oh well I guess I cannot.

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