?? commondialog.frm
字號:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "CommonDialog"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 2100
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 2100
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 360
TabIndex = 1
Top = 2760
Width = 1335
End
Begin VB.OptionButton Option1
Caption = "Option1"
Height = 495
Index = 0
Left = 240
TabIndex = 0
Top = 120
Width = 1815
End
Begin MSComDlg.CommonDialog CommonDialog1
Left = 240
Top = 1920
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Paint()
Static FlagFormPainted As Integer
' 當第一次畫窗體時,
If FlagFormPainted <> True Then
For i = 1 To 5
Load Option1(i) ' 給數組添加 5 個選項按鈕。
Option1(i).Top = Option1(i - 1).Top + 350
Option1(i).Visible = True
Next i
Option1(0).Caption = "“打開”對話框" ' 在每個選項按鈕上放置標題。
Option1(1).Caption = "“另存為”對話框"
Option1(2).Caption = "“顏色”對話框"
Option1(3).Caption = "“字體”對話框"
Option1(4).Caption = "“打印”對話框"
Option1(5).Caption = "幫助"
Command1.Caption = "顯示對話框" ' 標簽命令按鈕。
FlagFormPainted = True ' 窗體已畫完。
End If
End Sub
Private Sub Command1_Click()
If Option1(0).Value Then ' 如果選擇打開選箱,
CommonDialog1.ShowOpen ' 顯示打開公共對話框。
ElseIf Option1(1).Value Then ' 否則,
CommonDialog1.ShowSave ' 顯示 Save 公共對話框。
ElseIf Option1(2).Value Then ' 否則,
CommonDialog1.ShowColor ' 顯示 Color 公共對話框。
ElseIf Option1(3).Value Then ' 否則,
CommonDialog1.Flags = cdlCFBoth ' 在使用ShowFont 方法之前必須給 cdlCFBoth,cdlCFPrinterFonts 或 cdlCFScreenFonts置標識屬性。
CommonDialog1.ShowFont ' 顯示字體公共對話框。
ElseIf Option1(4).Value Then ' 或,
CommonDialog1.ShowPrinter ' 顯示打印機公共對話框。
ElseIf Option1(5).Value Then ' 或
CommonDialog1.HelpFile = "mplayer2.hlp"
CommonDialog1.HelpCommand = cdlHelpContents
CommonDialog1.ShowHelp ' 顯示 Visual Basic 幫助目錄主題。
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -