by Maduka Amarachi .J (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 15th May 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This displays all dialogue boxes
'Displays the CommonDialog color box
With CommonDialog1
.Flags = cdlCCRGBInit
.ShowColor
End With
CommonDialog1.Color = lblDisplay.ForeColor
CommonDialog1.Color = lblDisplay.BackColor
End Sub
Private Sub mnufileopen_Click()
'Displays the file open menu dialog box
CommonDialog1.CancelError = True
With CommonDialog1
.Filter = "All files(*.*)/*.*/Text files/*.*/batch files/*.bat"
.FilterIndex = 1
.ShowOpen
End With
frmDIALOGUS.mnufileopen = True
End Sub
Private Sub mnufileprint_Click()
'Displays the open dialog box
Dim beginpage As PrinterConstants
Dim endpage As PrinterConstants
Dim numcopies As PrinterConstants
Dim orientation As PrinterOrientationConstants
Dim i As Integer
CommonDialog1.ShowPrinter
With CommonDialog1
.FromPage = beginpage
.Copies = 1
.orientation = 1
.ToPage = endpage
For i = 1 To numcopies
Print #1, "This is a print line"
Next i
Exit Sub
End With
End Sub
Private Sub mnufilesaveas_Click()
'Displays the save as dialoge box
CommonDialog1.CancelError = True
With CommonDialog1
.Filter = "All files(*.*)/*.*/Text files/*.*/batch files/*.bat"
.FilterIndex = 1
.ShowSave
End With
frmDIALOGUS.mnufilesaveas = CommonDialog1.FileName
Exit Sub
End Sub
Private Sub mnufont_Click()
'DISPLAYS THE FONT DIALOG BOX
CommonDialog1.Flags = cdlCFScreenFonts
CommonDialog1.ShowFont
With lblDisplay.Font
.Name = CommonDialog1.FontName
.Size = CommonDialog1.FontSize
.Bold = CommonDialog1.FontBold
.Italic = CommonDialog1.FontItalic
.Underline = CommonDialog1.FontUnderline
End With
End Sub
Private Sub mnuhelpabout_Click()
'This displays the help file
MsgBox "Displays all dialog box" & vbCrLf & "programmed by Maduka Amarachi .j.", vbOKOnly, "About Dialogus"
End Sub
Private Sub optBlue_Click()
'Makes the lblmessage red
lblDisplay.ForeColor = vbBlue
End Sub
Private Sub optGreen_Click()
'Makes the lblmessage Green
lblDisplay.ForeColor = vbGreen
End Sub
here u need to create option button for alternative
Private Sub optRed_Click()
'Makes the lblmessage red
lblDisplay.ForeColor = vbRed
End Sub