I'm wanting to add a file 'open' dialog to system settings, to provide a simple 'user-friendly' way to get a file name into a system setting.
I suppose the same logic would apply to a custom form field.
Any pointers/examples?

Public Class SystemSettingPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaSystemSettingPlugin
'.
'. bits left out that don't matter.
'.
Public Sub ButtonClicked(ByVal BusinessLogicHost As JiwaApplication.IJiwaBusinessLogic, ByVal GridObject As JiwaApplication.Controls.JiwaGrid, ByVal FormObject As JiwaApplication.IJiwaForm, ByVal Col As Integer, ByVal Row As Integer, ByVal SystemSetting As JiwaApplication.SystemSettings.Setting) Implements JiwaApplication.IJiwaSystemSettingPlugin.ButtonClicked
' If Debugger.IsAttached Then Debugger.Break()
If SystemSetting.IDKey = "Invoice Email Report Filename" Then
Dim newFileDialog As OpenFileDialog = New OpenFileDialog() With {
.FileName = SystemSetting.Contents,
.CheckFileExists = True,
.DefaultExt = "RPT",
.Filter = "Crystal Reports (*.RPT)|*.RPT|All Files (*.*)|*,*",
.Multiselect = False,
.RestoreDirectory = True,
.SupportMultiDottedExtensions = True,
.DereferenceLinks = True
}
If newFileDialog.ShowDialog() = DialogResult.OK Then
SystemSetting.Contents = newFileDialog.FileName
End If
End If
End Sub
End Class

Return to Technical and or Programming
Users browsing this forum: No registered users and 4 guests