'Declaration
Public Sub CloseDocument()
public void CloseDocument()
public procedure CloseDocument();
public function CloseDocument();
public: void CloseDocument();
public: void CloseDocument();
The DocumentClosed event is raised at the end after the document has been successfully closed.
'Declaration
Public Sub CloseDocument()
public void CloseDocument()
public procedure CloseDocument();
public function CloseDocument();
public: void CloseDocument();
public: void CloseDocument();
'We assume that the GdViewer1 control has been properly integrated. Using dialog As System.Windows.Forms.FolderBrowserDialog = New System.Windows.Forms.FolderBrowserDialog() dialog.Description = "Select the folder you want to open your files from." dialog.ShowNewFolderButton = False dialog.RootFolder = Environment.SpecialFolder.Desktop If dialog.ShowDialog() = System.Windows.Forms.DialogResult.OK Then Dim folder As String = dialog.SelectedPath Dim fileName As String = "" For Each fName As String In System.IO.Directory.GetFiles(folder, "*.*", System.IO.SearchOption.TopDirectoryOnly) If GdViewer1.DisplayFromFile(fName) = GdPictureStatus.OK Then Dim result As MessageBoxResult = MessageBox.Show("Next file?", "GdViewer.CloseDocument", MessageBoxButton.YesNo) If result = MessageBoxResult.No Then fileName = fName Exit For Else GdViewer1.CloseDocument() End If End If Next 'Do your stuff with fileName. End If End Using
//We assume that the GdViewer1 control has been properly integrated. using (System.Windows.Forms.FolderBrowserDialog dialog = new System.Windows.Forms.FolderBrowserDialog()) { dialog.Description = "Select the folder you want to open your files from."; dialog.ShowNewFolderButton = false; dialog.RootFolder = Environment.SpecialFolder.Desktop; if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string folder = dialog.SelectedPath; string fileName = ""; foreach (string fName in System.IO.Directory.GetFiles(folder, "*.*", System.IO.SearchOption.TopDirectoryOnly)) { if (GdViewer1.DisplayFromFile(fName) == GdPictureStatus.OK) { MessageBoxResult result = MessageBox.Show("Next file?", "GdViewer.CloseDocument", MessageBoxButton.YesNo); if (result == MessageBoxResult.No) { fileName = fName; break; } else { GdViewer1.CloseDocument(); } } } //Do your stuff with fileName. } }