Solved

CommonDialog ShowFont help !

Posted on 2003-10-25
5
261 Views
Last Modified: 2013-12-03
Commondialog.ShowFont , it gives me an error
 "There are no fonts installed . Open the Fonts folder in control panel to install fonts " .

I went to control panel - Fonts and i found there's many fonts inside .

What's the matter with it ? how to fix it ?  i'm using Common Dialog 6 .
0
Comment
Question by:ANGmoh
5 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 9619730
From the VB Help file:

Before you use the ShowFont method, you must set the Flags property of the CommonDialog control to one of three constants or values: cdlCFBoth or &H3, cdlCFPrinterFonts or &H2, or cdlCFScreenFonts or &H1.  If you don't set Flags, a message box is displayed advising you that "There are no fonts installed," and a run-time error occurs.

So use one of these three lines of code:

CommonDialog1.flags = cdlCFBoth
CommonDialog1.flags = cdlCFPrinterFonts
CommonDialog1.flags = cdlCFScreenFonts

Before attempting to show the font dialog with:
CommonDialog1.ShowFont

Hope this helps!
0
 

Expert Comment

by:vbaddictor
ID: 9619908
oh ok thanks .

i have anohter question , and i'll increase the points to 50 if u can answer it too .. hehe .. too lazy to create another new question :P

by the way , can i show the color and font style selection box at the same time ?

ie . integrated common.showcolor and common.showfont at 1 time .
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 30 total points
ID: 9619931
Sorry, I know of no way to accomplish that using the Common Dialog Controls.  The dialog windows are displayed modally, meaning code execution stops until they are closed.

You would have to create your own custom Font/Color chooser form and manage ALL the gritty details of enumerating the fonts and generating colors yourself.
0
 
LVL 1

Author Comment

by:ANGmoh
ID: 9620039
hehe ok thanks . another 10 points for ur second answer :P
cheers
0
 

Expert Comment

by:TheMills2003
ID: 9620725
Hi there,

The answer to this error is simple. You have to VB which flags your using in the Show Font.

This Snippet of code will make your Show Font work:

cdlCommon.Flags = cdlCFBoth
cdlCommon.ShowFont

Hope This Help.
Gary Mills
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 55
what font behind pdf 32 150
VB6 - Convert HH:MM into Decimal 8 62
add criteria to query in VB, Access 2003 2 10
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question