Re: Common Dialog Font - Color Choices

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Bob,

Did you test this? flags = 0 prompts and error that no fonts are installed
and flags = cdlCCFullOpen doesn't even provide a color choice.

Anyways, here's my code:


Private Sub cmdFont_Click(Index As Integer)
' Set Cancel to True.
frmMain.dlg1.CancelError = True
On Error GoTo ErrHandler

frmMain.dlg1.flags = cdlCFEffects Or cdlCFBoth

'Assign defaults to the Common Dialog using what we already have
frmMain.dlg1.FontName = lblLocationFont(Index).FontName
frmMain.dlg1.FontSize = lblLocationFont(Index).FontSize
frmMain.dlg1.Color = lblLocationFont(Index).ForeColor
frmMain.dlg1.FontBold = lblLocationFont(Index).FontBold
frmMain.dlg1.FontBold = True


frmMain.dlg1.ShowFont

lblLocationFont(Index).FontName = frmMain.dlg1.FontName
lblLocationFont(Index).FontSize = frmMain.dlg1.FontSize
lblLocationFont(Index).FontBold = frmMain.dlg1.FontBold
lblLocationFont(Index).ForeColor = frmMain.dlg1.Color

ErrHandler:
' User pressed Cancel button.
Exit Sub

"Bob Butler" <tiredofit@xxxxxxxxxxx> wrote in message
news:%23sHazFOAHHA.4808@xxxxxxxxxxxxxxxxxxxxxxx
"wxforecaster" <wxforecaster@xxxxxxxxx> wrote in message
news:e0WX9MIAHHA.3536@xxxxxxxxxxxxxxxxxxxx
VB Gurus,

When I use the VB Common Dialog control to select a Font, I'd like
the user to be able to select the font color as well. However, even
with (what I think are) the correct flags set, the color drop down
menu provides 16 static color choices.

With no flags set you should see a 'define custom colors' option

Other MS programs I routinely use show a "17th" option for a custom
color, opening the color dialog box. I'd like to incorporate this
without having to provide the user with a whole other set of buttons
just to choose the color separately.

Many MS apps don't use the common dialog control or even the common dialog
API calls.

What flag or option am I missing?

Try it with
CommonDialog1.Flags = 0
or
CommonDialog1.Flags = cdlCCFullOpen

If it still fails post the section of code so people can see if you are
doing something else that may affect it

--
Reply to the group so all can participate
VB.Net: "Fool me once..."



.


Quantcast