Click here to Skip to main content
15,879,326 members
Articles / Desktop Programming / ATL

FontComboBox ActiveX Control

Rate me:
Please Sign up or sign in to vote.
4.91/5 (5 votes)
7 Aug 2002CPOL1 min read 92.8K   2.4K   32   8
Another FontComboBox class. This one uses the ATL technology.

Sample Image - FontCombo.gif

Overview

With this control, you can select a font among those available on the Windows machine. This is a standard ActiveX control, therefore it can be used in all applications supporting the ActiveX technology.

Where Is the Demo?

As this is an ActiveX, I have made it available online. In order to see it running, I suggest you download the control and then install it in the Windows Registry by using the command line - RegSvr32.exe FontCombo.dll. Next, click on the link below to see the control display under its different display modes:

COM Interface

Properties

C++
integer FontCombo.Aspect

Returns or sets the ComboBox aspect. Possible values are:

  • fcbStandard = 0
  • fcbOffice2000 = 1
  • fcbOfficeXP = 2
C++
boolean FontCombo.TransparentBorder

Returns or sets the transparent border. This style is only available with the Office2000 or OfficeXP aspects. This is a boolean value.

C++
string FontCombo.Selection

Returns or sets the current selected font name. A partial font name is allowed. The first corresponding font will be selected. This is a string value.

C++
boolean FontCombo.Enabled

Returns or sets the enabled state. This is a boolean value.

Events

C++
FontCombo.Onchange (string FontName)

Fired when the selected font name change. FontName is a string.

Notes

The font is used to display its name in the dropdown list. If it is a 'symbolic' font, its name is then clearly written.

License

This code is provided "as is" with no expressed or implied warranty. Feel free to modify and/or distribute this file, but do not remove the headers in place. You may use this code in a commercial product with or without acknowledgement. However, you may not sell this code or any modification of this code.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer CSC
France France
Jean-Michel LE FOL is a GraphTalk product architect.
GraphTalk is a set of products which cover the whole scope of the development process. GraphTalk is used by the main insurance compagnies over the world.
The development team is currently based in France near Paris.

Comments and Discussions

 
Questioncannot insert object Pin
anilmathpati12-Apr-12 1:28
anilmathpati12-Apr-12 1:28 
GeneralFonts for different languages Pin
Shragel31-Jan-07 9:47
Shragel31-Jan-07 9:47 
GeneralGreat work!! two minor remarks though Pin
Martijn30-Nov-02 8:39
Martijn30-Nov-02 8:39 
QuestionNo source? Pin
Chris Losinger8-Aug-02 19:09
professionalChris Losinger8-Aug-02 19:09 
AnswerRe: No source? Pin
Jean-Michel LE FOL8-Aug-02 20:41
Jean-Michel LE FOL8-Aug-02 20:41 
QuestionHow could I start to write an ActiveX control with C++? Pin
stan_lin7-Aug-02 17:55
stan_lin7-Aug-02 17:55 
AnswerRe: How could I start to write an ActiveX control with C++? Pin
Chris Maunder7-Aug-02 22:52
cofounderChris Maunder7-Aug-02 22:52 
GeneralRe: How could I start to write an ActiveX control with C++? Pin
stan_lin8-Aug-02 15:06
stan_lin8-Aug-02 15:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.