From 551e86939287ad2b77ed16d656b19cee1e2c575e Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 17 Jul 2019 12:22:55 +0200 Subject: [PATCH 1/2] use checkstate for checkboxes --- app/DD_PM_WINDREAM/ClassControlCreator.vb | 4 +++- app/DD_PM_WINDREAM/frmMassValidator.vb | 6 +++++- app/DD_PM_WINDREAM/frmValidator.vb | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/DD_PM_WINDREAM/ClassControlCreator.vb b/app/DD_PM_WINDREAM/ClassControlCreator.vb index 867690c..ead7752 100644 --- a/app/DD_PM_WINDREAM/ClassControlCreator.vb +++ b/app/DD_PM_WINDREAM/ClassControlCreator.vb @@ -116,7 +116,8 @@ Public Class ClassControlCreator .AutoSize = True, .Text = DEFAULT_TEXT, .Cursor = Cursors.Hand, - .Location = location + .Location = location, + .CheckState = CheckState.Indeterminate } Return control @@ -278,6 +279,7 @@ Public Class ClassControlCreator control.AutoSize = True control.Text = row.Item("CTRL_TEXT") + control.CheckState = CheckState.Indeterminate If Not designMode Then control.Enabled = Not row.Item("READ_ONLY") diff --git a/app/DD_PM_WINDREAM/frmMassValidator.vb b/app/DD_PM_WINDREAM/frmMassValidator.vb index b7ab5e6..65d0812 100644 --- a/app/DD_PM_WINDREAM/frmMassValidator.vb +++ b/app/DD_PM_WINDREAM/frmMassValidator.vb @@ -1543,12 +1543,16 @@ Public Class frmMassValidator Dim chk As CheckBox = oControl oMyControlInput = chk.Checked.ToString - If chk.Checked = False And _MUSSEINGABE = True Then + If chk.CheckState = CheckState.Indeterminate And _MUSSEINGABE = True Then oMissing = True oErrorMessage = "Option '" & chk.Name & "' is required." Exit For End If + If chk.CheckState = CheckState.Indeterminate Then + LOGGER.Debug("Checkbox {0} is indeterminate. Skipping indexing.", chk.Name) + Exit For + End If Dim result() As String ReDim Preserve result(0) diff --git a/app/DD_PM_WINDREAM/frmValidator.vb b/app/DD_PM_WINDREAM/frmValidator.vb index 0a84b78..26174d0 100644 --- a/app/DD_PM_WINDREAM/frmValidator.vb +++ b/app/DD_PM_WINDREAM/frmValidator.vb @@ -3299,7 +3299,7 @@ Public Class frmValidator Dim chk As CheckBox = oControl input = chk.Checked.ToString - If chk.Checked = False And oIsRequired = True Then + If chk.CheckState = CheckState.Indeterminate And oIsRequired = True Then oMissing = True oErrorMessage = "Option '" & chk.Name & "' is required." Exit For @@ -3336,6 +3336,10 @@ Public Class frmValidator End If + If chk.CheckState = CheckState.Indeterminate Then + LOGGER.Debug("Checkbox {0} is indeterminate. Skipping indexing.", oControlName) + Exit For + End If ' Dim Bool_WD = CBool(CURRENT_WMFILE.GetVariableValue(_IDXName)) From 1dd585531e4ed75af4ad60384652a7ab22516aed Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 17 Jul 2019 16:08:50 +0200 Subject: [PATCH 2/2] fix connection string in control detail --- app/DD_PM_WINDREAM/frmControl_Detail.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/DD_PM_WINDREAM/frmControl_Detail.vb b/app/DD_PM_WINDREAM/frmControl_Detail.vb index 0ea6cf0..45f0937 100644 --- a/app/DD_PM_WINDREAM/frmControl_Detail.vb +++ b/app/DD_PM_WINDREAM/frmControl_Detail.vb @@ -9,6 +9,7 @@ Public Class frmControl_Detail Public Function FillData(ID As Integer) Try + TBPM_CONTROL_TABLETableAdapter.Connection.ConnectionString = CONNECTION_STRING TBPM_CONTROL_TABLETableAdapter.FillByGUID(DD_DMSLiteDataSet.TBPM_CONTROL_TABLE, ID) Return True Catch ex As System.Exception @@ -60,7 +61,6 @@ Public Class frmControl_Detail Me.Location = My.Settings.frmTableColumns_Position End If End If - Me.TBPM_CONTROL_TABLETableAdapter.Connection.ConnectionString = CONNECTION_STRING Catch ex As Exception LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden der Formulardaten:")