Click to See Complete Forum and Search --> : Dialog Box's


Juan Amore
October 10th, 2001, 05:32 PM
Do's anyone know who to create a basic Cfont dialog box and a CColor palette dialog box.
Is there a one liner command code like the MSG command or do I need to contruct this...

Whats code-steps do I need to take to construct one of these so that when I click a Font or Color Menu button a popup window will display showing
a basic Font,Font style,Size,Script & sample window and a color palette window..
Thanks:) A beginner using VB

Juan Amore

Cakkie
October 11th, 2001, 01:36 AM
You can use the commondialog controls for that. You can add them to your projects using the projects>components menu. There select 'Microsoft Common Dialog Controls'. Add a button and a commondialogcontrol (i called it CDL) to the form. Then paste following code:

private Sub Command1_Click()

CDL.ShowColor
MsgBox "The selected color is: " & CDL.Color

CDL.ShowFont
MsgBox "The selected font is: " & CDL.FontName & " size " & CDL.FontSize

End Sub



Run the project, press the button. First the color dialog will pop up, after you selected a color, the font dialog will pop up.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook