Dialog Properties Reference
📋 Property List
| Property | Type | Description |
|---|---|---|
DialogTitle | String | Dialog title |
InitialDir | String | Initial directory |
DefaultExt | String | Default extension |
FileName | String | Default/selected filename |
Filter | String | File filter |
MultiSelect | Boolean | Allow multi-select |
OverwritePrompt | Boolean | Prompt for overwrite on save |
PathMustExist | Boolean | Path must exist |
FileMustExist | Boolean | File must exist |
HideReadOnly | Boolean | Hide read-only checkbox |
NewDialogStyle | Boolean | Use new dialog style |
🏷️ DialogTitle Property
Description
Sets or gets the text displayed in the dialog title bar.
Syntax
vb
Public Property Let DialogTitle(ByVal vValue As String)
Public Property Get DialogTitle() As StringExample
vb
Dim dlg As New cDialog
dlg.DialogTitle = "Please select file to open"
Dim file As String
file = dlg.ShowOpen📁 InitialDir Property
Description
Sets or gets the initial directory when dialog opens.
Syntax
vb
Public Property Let InitialDir(ByVal vValue As String)
Public Property Get InitialDir() As StringExample
vb
dlg.InitialDir = "C:\Users\Documents"📎 DefaultExt Property
Description
Sets or gets the default file extension (without dot).
Syntax
vb
Public Property Let DefaultExt(ByVal vValue As String)
Public Property Get DefaultExt() As StringExample
vb
dlg.DefaultExt = "txt" ' Default save as .txt file📄 FileName Property
Description
Sets default filename or gets user-selected filename.
Syntax
vb
Public Property Let FileName(ByVal vValue As String)
Public Property Get FileName() As StringExample
vb
' Set default filename
dlg.FileName = "New Document.txt"
' Get selected filename (after ShowOpen/Save)
Dim selected As String
selected = dlg.FileName🔍 Filter Property
Description
Sets or gets file filter string. Format: Description1|Pattern1|Description2|Pattern2
Syntax
vb
Public Property Let Filter(ByVal vValue As String)
Public Property Get Filter() As StringExample
vb
' Set filter directly
dlg.Filter = "Text Files|*.txt|All Files|*.*"
' Use AddFilter method
dlg.AddFilter "Text Files", "*.txt"
dlg.AddFilter "All Files", "*.*"☑️ MultiSelect Property
Description
Sets or gets whether to allow multi-file selection.
Syntax
vb
Public Property Let MultiSelect(ByVal vValue As Boolean)
Public Property Get MultiSelect() As BooleanExample
vb
dlg.MultiSelect = True
Dim files As Collection
Set files = dlg.SelectFiles ' Returns Collection⚠️ OverwritePrompt Property
Description
Sets or gets whether to prompt for overwrite when saving file that already exists.
Syntax
vb
Public Property Let OverwritePrompt(ByVal vValue As Boolean)
Public Property Get OverwritePrompt() As BooleanExample
vb
dlg.OverwritePrompt = True ' Enabled by default✅ PathMustExist Property
Description
Sets or gets whether path must exist.
Syntax
vb
Public Property Let PathMustExist(ByVal vValue As Boolean)
Public Property Get PathMustExist() As BooleanExample
vb
dlg.PathMustExist = True ' Enabled by default📋 FileMustExist Property
Description
Sets or gets whether file must exist (open dialog only).
Syntax
vb
Public Property Let FileMustExist(ByVal vValue As Boolean)
Public Property Get FileMustExist() As BooleanExample
vb
dlg.FileMustExist = True ' Enabled by default🎨 NewDialogStyle Property
Description
Sets or gets whether to use new dialog style (folder selection dialog).
Syntax
vb
Public Property Let NewDialogStyle(ByVal vValue As Boolean)
Public Property Get NewDialogStyle() As BooleanExample
vb
dlg.NewDialogStyle = True ' Use new style with edit boxLast Updated: 2026-05-17