Sie sind auf Seite 1von 3

1/29/2017 www.minich.com/education/racc/visualbasic/cis230ch5/frmcis230ch5demo1form1.

txt

VERSION5.00
Object="{F9043C88F6F2101AA3C908002B2F49FB}#1.2#0";"COMDLG32.OCX"
BeginVB.Formfrmchecking
Caption="CheckingAccountBalance"
ClientHeight=2625
ClientLeft=165
ClientTop=735
ClientWidth=3690
LinkTopic="Form1"
ScaleHeight=2625
ScaleWidth=3690
StartUpPosition=3'WindowsDefault
BeginMSComDlg.CommonDialogdlgCommon
Left=120
Top=1200
_ExtentX=847
_ExtentY=847
_Version=393216
End
BeginVB.LabellblLabel
Alignment=2'Center
BorderStyle=1'FixedSingle
Caption="HelloWorld"
BeginPropertyFont
Name="MSSansSerif"
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
BeginVB.MenumnuEdit
Caption="&Edit"
BeginVB.MenumnuEditFont
Caption="&Font"
End
BeginVB.MenumnuEditColor
Caption="&Color"
End
BeginVB.MenumnuSep1

http://www.minich.com/education/racc/visualbasic/cis230ch5/frmcis230ch5demo1form1.txt 1/3
1/29/2017 www.minich.com/education/racc/visualbasic/cis230ch5/frmcis230ch5demo1form1.txt

Caption=""
End
BeginVB.MenumnuEditExit
Caption="E&xit"
End
End
End
AttributeVB_Name="frmchecking"
AttributeVB_GlobalNameSpace=False
AttributeVB_Creatable=False
AttributeVB_PredeclaredId=True
AttributeVB_Exposed=False
'CIS230Ch5Demo1
'Mr.Minich
'ThisprogramdemonstratestheuseoftheColorandFontdialogboxes(seepp.177181).Youneedtoplace
'thecommondialogcontrolonyourforminordertousethesedialogboxes.Ifyoudonotseethecommon
'dialogcontrolinyourtoolbox,youmustclicktheProjects/Componentsmenucommandandplaceachecknext
'totheitemcalled"MicrosoftCommonDialogControl6.0".Usetheprefix"dlg"whenyounamethecommondialog
'controlinyourprojectorsimplyusethename"dlgCommon".

OptionExplicit

PrivateSubmnuEditFont_Click()
'Displaysthecommondialogboxtochangethefont
'propertiesofalabel.

WithdlgCommon
.FontName=lblLabel.Font.Name'setinitialfontpropertiesoffontdialogbox
.FontBold=lblLabel.Font.Bold'tothoseofthelabel
.FontItalic=lblLabel.Font.Italic
.FontSize=lblLabel.Font.Size
.Flags=cdlCFScreenFonts'necessarytospecifyscreenfonts
.ShowFont'displaythedialogbox
EndWith

WithlblLabel.Font
.Name=dlgCommon.FontName'changethefontpropertiesofthelabeltothose
.Bold=dlgCommon.FontBold'selectedinthefontdialogbox
.Italic=dlgCommon.FontItalic
.Size=dlgCommon.FontSize
EndWith

EndSub

PrivateSubmnuEditColor_Click()
'Displaysthecommondialogboxtochangetheforeground
'colorofalabel

WithdlgCommon
http://www.minich.com/education/racc/visualbasic/cis230ch5/frmcis230ch5demo1form1.txt 2/3
1/29/2017 www.minich.com/education/racc/visualbasic/cis230ch5/frmcis230ch5demo1form1.txt

.Flags=cdlCCRGBInit'necessarytoinitializethedialogbox
.Color=lblLabel.ForeColor'setinitialcolortothecurrentForeColorofthelabel
.ShowColor'displaydialogbox
lblLabel.ForeColor=.Color'settingthenewchosencolortothelabel'sForeColor
EndWith

EndSub

http://www.minich.com/education/racc/visualbasic/cis230ch5/frmcis230ch5demo1form1.txt 3/3

Das könnte Ihnen auch gefallen