ISDBApplication::CommonDialog: Difference between revisions

From MediaMonkey Wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==[[SDBApplication#ISDBApplication_members|ISDBApplication]]::CommonDialog==
{{MethodDeclaration|SDBApplication|ISDBApplication|Property Get CommonDialog As ISDBCommonDialog}}


''Property Get CommonDialog As ISDBCommonDialog''
===Property description===


No parameters
Returns a [[SDBCommonDialog]] object that can be used to show load/save file dialogs.
===Property description===


Returns SDBCommonDialog object that can be used then to show load/save file dialogs.
===Example code===                  
===Example code===
<source lang="vb">' Create common dialog and ask where to save the file
<source lang="vb">' Create common dialog and ask where to save the file
Dim dlg
Dim dlg : Set dlg = SDB.CommonDialog
Set dlg = SDB.CommonDialog
dlg.DefaultExt = "mp3"
dlg.DefaultExt='mp3'
dlg.Filter = "Mp3 files (*.mp3)|*.mp3|All files (*.*)|*.*"
dlg.Filter=filter
dlg.Flags = cdlOFNOverwritePrompt + cdlOFNHideReadOnly
dlg.Flags=cdlOFNOverwritePrompt + cdlOFNHideReadOnly
dlg.InitDir = SDB.IniFile.StringValue("Scripts", iniDirValue)
dlg.InitDir = iniF.StringValue( "Scripts", iniDirValue)
dlg.ShowSave
dlg.ShowSave


if Not dlg.Ok Then
If Not dlg.Ok Then
   Exit Sub  ' if cancel was pressed, exit
   Exit Sub  ' if cancel was pressed, exit
End If
End If


' Get the selected filename
' Get the selected filename
fullfile = dlg.FileName</source>
Dim fullfile : fullfile = dlg.FileName</source>


[[Category:Scripting|{{PAGENAME}}]]
[[Category:Scripting|{{PAGENAME}}]]

Latest revision as of 15:43, 4 November 2007

CoClass SDBApplication, Interface ISDBApplication

Property Get CommonDialog As ISDBCommonDialog


Property description

Returns a SDBCommonDialog object that can be used to show load/save file dialogs.

Example code

' Create common dialog and ask where to save the file
Dim dlg : Set dlg = SDB.CommonDialog
dlg.DefaultExt = "mp3"
dlg.Filter = "Mp3 files (*.mp3)|*.mp3|All files (*.*)|*.*"
dlg.Flags = cdlOFNOverwritePrompt + cdlOFNHideReadOnly
dlg.InitDir = SDB.IniFile.StringValue("Scripts", iniDirValue)
dlg.ShowSave

If Not dlg.Ok Then
  Exit Sub   ' if cancel was pressed, exit
End If

' Get the selected filename
Dim fullfile : fullfile = dlg.FileName