Solved

CommonDialog ShowFont help !

Posted on 2003-10-25
5
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 86

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 86

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

628 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