borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (PictureBox Problem!!! Help!)Next Topic (Dockable Windows? (I think)) New Topic New Poll Post Reply
AndreaVB Forum : VB General : How to hidden Style and Size from Font Dialog box
Poster Message
swqahk
Level: Guest


icon How to hidden Style and Size from Font Dialog box  Archived to Disk

Hello

I am currently using the Font Dialog box for user to select their font. the font size and font style is not necessary. Is there any way to hidden this two list boxes?
Or is there any other method to list all the
font that use the Windows character set (I don't want Font contains only symbols)

Please help

31-05-2002 at 02:27 AM
| Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: How to hidden Style and Size from Font Dialog box  Archived to Disk

The following url has a sample of how to get fonts: http://www.mvps.org/vbnet/index.html?code/enums/enumfontbytype.htm

Otherwise, using the common dialog control, the following is from the MSDN library:

Flags Property (Font Dialog)
      

Returns or sets the options for the Font dialog box.

Syntax

object.Flags [= value]

The Flags property syntax has these parts:

Part Description
object Anobject expression that evaluates to an object in the Applies To list.
value Aconstant or value specifying the options for a Font dialog box, as described in Settings.


Settings

The settings for value are:

Constant Value Description
cdlCFANSIOnly &H400 Specifies that the dialog box allows only a selection of the fonts that use the Windows character set. If this flag is set, the user won't be able to select a font that contains only symbols.
cdlCFApply &H200 Enables the Apply button on the dialog box.
cdlCFBoth &H3 Causes the dialog box to list the available printer and screen fonts. The hDC property identifies thedevice context associated with the printer.
cdlCFEffects &H100 Specifies that the dialog box enables strikethrough, underline, and color effects.  
cdlCFFixedPitchOnly &H4000 Specifies that the dialog box selects only fixed-pitch fonts.
cdlCFForceFontExist &H10000 Specifies that an error message box is displayed if the user attempts to select a font or style that doesn't exist.
cdlCFHelpButton &H4 Causes the dialog box to display a Help button.
cdlCFLimitSize &H2000 Specifies that the dialog box selects only font sizes within the range specified by the Min and Max properties.
cdlCFNoFaceSel &H80000 No font name selected.
cdlCFNoSimulations &H1000 Specifies that the dialog box doesn't allow graphic device interface (GDI) font simulations.
cdlCFNoSizeSel &H200000 No font size selected.
cdlCFNoStyleSel &H100000 No style was selected.
cdlCFNoVectorFonts &H800 Specifies that the dialog box doesn't allow vector-font selections.
cdlCFPrinterFonts &H2 Causes the dialog box to list only the fonts supported by the printer, specified by the hDC property.
cdlCFScalableOnly &H20000 Specifies that the dialog box allows only the selection of fonts that can be scaled.
cdlCFScreenFonts &H1 Causes the dialog box to list only the screen fonts supported by the system.
cdlCFTTOnly &H40000 Specifies that the dialog box allows only the selection of TrueType fonts.
cdlCFWYSIWYG &H8000 Specifies that the dialog box allows only the selection of fonts that are available on both the printer and on screen. If this flag is set, the cdlCFBoth and cdlCFScalableOnly flags should also be set.


Remarks

These constants are listed in the Microsoft CommonDialog Control (MSComDlg)object library in the Object Browser.

You can also define selected flags. Use the Const keyword in the Declarations section of the startup form to define the flags you want to use. For example:

Const ReadOnly  = &H00000001&
Const Effects  = &H00000100&

You can set more than one flag for a dialog box using the Or operator. For example:

CommonDialog1.Flags = &H10& Or &H200&

Adding the desired constant values produces the same results. The following is equivalent to the preceding example:

CommonDialog1.Flags = &H210&

Note   You must set the Flags property to cdlCFScreenFonts, cdlCFPrinterFonts, or cdlCFBoth before displaying the Fonts dialog box. Otherwise, the error No Fonts Exist occurs.

Data Type

Long

31-05-2002 at 03:40 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB General : How to hidden Style and Size from Font Dialog box
Previous Topic (PictureBox Problem!!! Help!)Next Topic (Dockable Windows? (I think)) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder