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.
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.
Re: Common Dialog selecting fonts as regular files
Yeah, I was trying to avoid that... Oh well I guess I cannot.