VERSION 5.00 Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX" Begin VB.Form frmchecking Caption = "Checking Account Balance" ClientHeight = 2625 ClientLeft = 165 ClientTop = 735 ClientWidth = 3690 LinkTopic = "Form1" ScaleHeight = 2625 ScaleWidth = 3690 StartUpPosition = 3 'Windows Default Begin MSComDlg.CommonDialog dlgCommon Left = 120 Top = 1200 _ExtentX = 847 _ExtentY = 847 _Version = 393216 End Begin VB.Label lblLabel Alignment = 2 'Center BorderStyle = 1 'Fixed Single Caption = "Hello World" BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00000000& Height = 615 Left = 720 TabIndex = 0 Top = 240 Width = 2295 End Begin VB.Menu mnuEdit Caption = "&Edit" Begin VB.Menu mnuEditFont Caption = "&Font" End Begin VB.Menu mnuEditColor Caption = "&Color" End Begin VB.Menu mnuSep1 Caption = "-" End Begin VB.Menu mnuEditExit Caption = "E&xit" End End End Attribute VB_Name = "frmchecking" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False 'CIS 230 Ch 5 Demo 1 'Mr. Minich 'This program demonstrates the use of the Color and Font dialog boxes (see pp. 177-181). You need to place ' the common dialog control on your form in order to use these dialog boxes. If you do not see the common ' dialog control in your toolbox, you must click the Projects/Components menu command and place a check next ' to the item called "Microsoft Common Dialog Control 6.0". Use the prefix "dlg" when you name the common dialog ' control in your project or simply use the name "dlgCommon". Option Explicit Private Sub mnuEditFont_Click() 'Displays the common dialog box to change the font 'properties of a label. With dlgCommon .FontName = lblLabel.Font.Name 'set initial font properties of font dialog box .FontBold = lblLabel.Font.Bold ' to those of the label .FontItalic = lblLabel.Font.Italic .FontSize = lblLabel.Font.Size .Flags = cdlCFScreenFonts 'necessary to specify screen fonts .ShowFont 'display the dialog box End With With lblLabel.Font .Name = dlgCommon.FontName 'change the font properties of the label to those .Bold = dlgCommon.FontBold ' selected in the font dialog box .Italic = dlgCommon.FontItalic .Size = dlgCommon.FontSize End With End Sub Private Sub mnuEditColor_Click() 'Displays the common dialog box to change the foreground 'color of a label With dlgCommon .Flags = cdlCCRGBInit 'necessary to initialize the dialog box .Color = lblLabel.ForeColor 'set initial color to the current ForeColor of the label .ShowColor 'display dialog box lblLabel.ForeColor = .Color 'setting the new chosen color to the label's ForeColor End With End Sub