I have DeskSite 8.2 installed. While using the IIntegrationDlg.DocOpenDlg object in VB .net with Visual Studio 2008, setting the CloseOnOK property to false has no effect.
I would like to prevent the dialog box from closing when the Open button is clicked, but no document is selected.
The event MyDialogOK is getting fired, but the dialog box closes when I click Open or Cancel. Setting the value of pMyInterface.CloseOnOK within that event never prevents the dialog from closing. I've tried it with True and with False. I've also tried setting MyDialog.CloseOnOK to both true and false before showing the dialog, but neither setting prevented the dialog from closing.
Here's my code. Is there something else I need to do to get this dialog to perform as it's described in the documentation?
Imports IManage
Public Class Form1
Dim WithEvents MyDialog As IIntegrationDlg.DocOpenDlg
Private Sub MyDialogOK(ByVal pMyInterface As IIntegrationDlg.DocOpenDlg) Handles MyDialog.OnOK
Dim docSelected As Boolean
Dim DocArray As Array
DocArray = MyDialog.DocumentList
docSelected = DocArray.Length > 0
pMyInterface.CloseOnOK = docSelected
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim commands(1) As String
Dim DocArray As Array
MyDialog = New IIntegrationDlg.DocOpenDlg
Dim userSession As IManSession
Dim dmsServer As New NRTDMS
userSession = dmsServer.Sessions.Add("xxxx")
userSession.Login("xxxx", "xxxx")
MyDialog.NRTDMS = dmsServer
MyDialog.SingleSel = True
MyDialog.CloseOnOK = False
commands(0) = "@1@&Open"
MyDialog.CommandList = commands
MyDialog.Show(Me.Handle)
If MyDialog.CommandSelected > -1 Then
DocArray = MyDialog.DocumentList
If DocArray.Length > 0 Then
Dim aDoc As NRTDocument = MyDialog.DocumentList(0)
'Process document here.
End If
End If
MyDialog = Nothing
End Sub
End Class