Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

FontComboBox ActiveX Control

0.00/5 (No votes)
7 Aug 2002 1  
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

integer FontCombo.Aspect

Returns or sets the ComboBox aspect. Possible values are:

  • fcbStandard = 0
  • fcbOffice2000 = 1
  • fcbOfficeXP = 2
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.

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.

boolean FontCombo.Enabled

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

Events

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here