CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Dialog Box's

  1. #1
    Join Date
    Oct 2001
    Location
    CA
    Posts
    16

    Dialog Box's

    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

  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Dialog Box's

    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
    [email protected]

    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
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured