Switch from Textbox to DevExpress TextEdit

This commit is contained in:
Jonathan Jenne 2023-05-30 13:33:22 +02:00
parent 37b02ec625
commit 9da71349b2
6 changed files with 186 additions and 82 deletions

View File

@ -14,9 +14,11 @@ Imports DigitalData.Controls.LookupGrid
Imports DigitalData.Modules.Language.Utils
Imports DigitalData.GUIs.Common
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.EDMI.API.DatabaseWithFallback
Imports DigitalData.Modules.EDMI.API.Constants
Imports DigitalData.Modules.Language.DataTableEx
Imports DigitalData.Modules.Base
Public Class ClassControlCreator
@ -86,6 +88,7 @@ Public Class ClassControlCreator
Public Guid As Integer
Public Name As String
Public [ReadOnly] As Boolean = False
Public BackColor As Color = Color.White
End Class
Private Shared Function TransformDataRow(row As DataRow) As ControlDBProps
@ -146,8 +149,21 @@ Public Class ClassControlCreator
' ----------------------- NEW CONTROLS -----------------------
Public Shared Function CreateNewTextBox(location As Point) As TextBox
Dim control As New TextBox With {
'Public Shared Function CreateNewTextBox(location As Point) As TextBox
' Dim control As New TextBox With {
' .Name = $"{PREFIX_TEXTBOX}_{clsTools.ShortGuid()}",
' .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
' .Location = location,
' .ReadOnly = True,
' .BackColor = Color.White,
' .Cursor = Cursors.Hand
' }
' Return control
'End Function
Public Shared Function CreateNewTextBox(location As Point) As TextEdit
Dim control As New TextEdit With {
.Name = $"{PREFIX_TEXTBOX}_{clsTools.ShortGuid()}",
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
.Location = location,
@ -280,35 +296,88 @@ Public Class ClassControlCreator
' ----------------------- EXISITING CONTROLS -----------------------
Public Shared Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As TextBox
'Public Shared Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As TextBox
' Try
' Dim control As TextBox = CreateBaseControl(New TextBox(), oControlRow, designMode)
' control.BackColor = Color.White
' If oControlRow.Item("HEIGHT") > 27 Then
' control.Multiline = True
' End If
' control.Height = oControlRow.Item("HEIGHT")
' control.Width = oControlRow.Item("WIDTH")
' If Not designMode Then
' control.AcceptsReturn = True
' control.ReadOnly = oControlRow.Item("READ_ONLY")
' control.TabStop = Not oControlRow.Item("READ_ONLY")
' control.BackColor = IIf(oControlRow.Item("READ_ONLY"), Color.LightGray, Color.White)
' control.ScrollBars = ScrollBars.Vertical
' Else
' control.ReadOnly = True
' End If
' Return control
' Catch ex As Exception
' Logger.Error(ex)
' End Try
'End Function
Public Shared Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As TextEdit
Try
Dim control As TextBox = CreateBaseControl(New TextBox(), oControlRow, designMode)
Dim oControl As TextEdit = CreateBaseControl(New TextEdit(), oControlRow, designMode)
Dim oMeta As ControlMetadata = oControl.Tag
control.BackColor = Color.White
oControl.BackColor = Color.White
oMeta.BackColor = Color.White
If oControlRow.Item("HEIGHT") > 27 Then
control.Multiline = True
' TODO: Add separate function for MultilineEdit
'If oControlRow.Item("HEIGHT") > 27 Then
' control.Multiline = True
'End If
End If
Dim oHeight = oControlRow.ItemEx("HEIGHT", 0)
Dim oWidth = oControlRow.ItemEx("WIDTH", 0)
Dim oReadOnly = oControlRow.ItemEx("READ_ONLY", False)
Dim oFormatString = oControlRow.ItemEx("FORMAT_STRING", String.Empty)
Dim oBackColorIf = oControlRow.ItemEx("CTRL_BACKCOLOR_IF", String.Empty)
control.Height = oControlRow.Item("HEIGHT")
control.Width = oControlRow.Item("WIDTH")
oControl.Height = oHeight
oControl.Width = oWidth
If Not designMode Then
control.AcceptsReturn = True
control.ReadOnly = oControlRow.Item("READ_ONLY")
control.TabStop = Not oControlRow.Item("READ_ONLY")
control.BackColor = IIf(oControlRow.Item("READ_ONLY"), Color.LightGray, Color.White)
control.ScrollBars = ScrollBars.Vertical
Else
control.ReadOnly = True
oControl.ReadOnly = oReadOnly
oControl.TabStop = Not oReadOnly
oControl.BackColor = IIf(oReadOnly, Color.LightGray, Color.White)
' If there is a format string defined, set it for display only.
' Editing will be without format string, according to current user-culture.
If oFormatString <> String.Empty Then
oControl.Properties.DisplayFormat.FormatType = FormatType.Custom
oControl.Properties.DisplayFormat.FormatString = ClassFormat.GetFormatString(oFormatString)
End If
Return control
' For read only controls, don't show the raw value when a user clicks into it
If oReadOnly Then
oControl.Properties.EditFormat.FormatType = FormatType.Custom
oControl.Properties.EditFormat.FormatString = ClassFormat.GetFormatString(oFormatString)
End If
'TODO: Find alternatives for TextEdit
'control.ScrollBars = ScrollBars.Vertical
'control.AcceptsReturn = True
Else
oControl.ReadOnly = True
End If
Return oControl
Catch ex As Exception
Logger.Error(ex)
End Try
End Function
Public Shared Function CreateExistingLabel(row As DataRow, designMode As Boolean) As Label

View File

@ -9,6 +9,26 @@ Public Class ClassFormat
Public Const DATE_FORMAT = "d"
Public Const DATETIME_FORMAT = "G"
Public Shared Function GetFormatString(pFormatString As String) As String
Select Case pFormatString
Case ClassControlCreator.CONTROL_TYPE_CURRENCY
Return CURRENCY_FORMAT
Case ClassControlCreator.CONTROL_TYPE_DOUBLE
Return DECIMAL_FORMAT
Case ClassControlCreator.CONTROL_TYPE_DATE
Return DATE_FORMAT
Case ClassControlCreator.CONTROL_TYPE_DATETIME
Return DATETIME_FORMAT
Case Else
Return String.Empty
End Select
End Function
Public Shared Function GetFormattedValue(pControlName As String, pValueObject As Object, pFormatString As String) As String
Try
If pFormatString <> String.Empty Then

View File

@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("TaskFlow")>
<Assembly: AssemblyCopyright("Copyright © Digital Data 2023")>
<Assembly: AssemblyTrademark("2.4.2.2")>
<Assembly: AssemblyTrademark("2.4.3.0")>
<Assembly: ComVisible(False)>
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.2.2")>
<Assembly: AssemblyVersion("2.4.3.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@ -10,6 +10,7 @@ Imports DigitalData.Modules.Language
Imports System.Drawing
Imports DigitalData.GUIs.Common
Imports DevExpress.Utils.Filtering.Internal
Imports DevExpress.XtraEditors
Public Class frmFormDesigner
Public ProfileId As Integer
@ -256,7 +257,7 @@ Public Class frmFormDesigner
' Jetzt die Control spezifischen Eigenschaften zuweisen
Select Case row.Item("CTRL_TYPE")
Case "TXT"
Case ClassControlCreator.PREFIX_TEXTBOX
Dim txt = ClassControlCreator.CreateExistingTextbox(row, True)
pnldesigner.Controls.Add(txt)
SetMovementHandlers(txt)
@ -343,7 +344,7 @@ Public Class frmFormDesigner
If oMetadata.ReadOnly = False Then
Dim Type As String = oControl.GetType.ToString
Select Case Type
Case "System.Windows.Forms.TextBox"
Case "DevExpress.XtraEditors.TextEdit"
oControl.BackColor = Color.White
Case "System.Windows.Forms.ComboBox"
oControl.BackColor = Color.White
@ -664,8 +665,8 @@ Public Class frmFormDesigner
checkProps.Enable_SQL_OnLoad = New SQLValue(NotNull(oRow.Item("SQL_ENABLE_ON_LOAD"), ""))
checkProps.SetControlData = New SQLValue(NotNull(oRow.Item("SET_CONTROL_DATA"), ""))
props = checkProps
ElseIf TypeOf sender Is TextBox Then
Dim txt As TextBox = sender
ElseIf TypeOf sender Is TextEdit Then
Dim txt As TextEdit = sender
Dim txtProps As TextboxProperties = CreatePropsObjectWithIndicies(New TextboxProperties, oRow, Source_AllIndicies)
txtProps.Regex = NotNull(oRow.Item("REGEX_MATCH"), String.Empty)
txtProps.RegexMessage = NotNull(oRow.Item("REGEX_MESSAGE_DE"), String.Empty)
@ -676,8 +677,8 @@ Public Class frmFormDesigner
props = txtProps
ElseIf TypeOf sender Is ComboBox Then
Dim cmb As ComboBox = sender
ElseIf TypeOf sender Is Windows.Forms.ComboBox Then
Dim cmb As Windows.Forms.ComboBox = sender
Dim cmbProps As ComboboxProperties = CreatePropsObjectWithIndicies(New ComboboxProperties, oRow, Source_AllIndicies)
cmbProps.ChoiceLists = Windream_ChoiceLists
cmbProps.ChoiceList = NotNull(oRow.Item("CHOICE_LIST"), String.Empty)
@ -1286,9 +1287,10 @@ Public Class frmFormDesigner
If CurrentControl Is Nothing = False Then
Dim newHeight As Integer = CurrentControl.Height - 5
If newHeight < 22 And TypeOf CurrentControl Is TextBox Then
DirectCast(CurrentControl, TextBox).Multiline = True
End If
' TODO: Implement Multiline TextBox
'If newHeight < 22 And TypeOf CurrentControl Is TextBox Then
' DirectCast(CurrentControl, TextBox).Multiline = True
'End If
' Verhindert, dass das Control unsichtbar wird
If newHeight < 1 Then
@ -1307,9 +1309,10 @@ Public Class frmFormDesigner
If CurrentControl Is Nothing = False Then
Dim newHeight As Integer = CurrentControl.Height + 5
If newHeight > 21 And TypeOf CurrentControl Is TextBox Then
DirectCast(CurrentControl, TextBox).Multiline = True
End If
' TODO: Implement Multiline Textbox
'If newHeight > 21 And TypeOf CurrentControl Is TextBox Then
' DirectCast(CurrentControl, TextBox).Multiline = True
'End If
CurrentControl.Size = New Size(CurrentControl.Width, newHeight)
DirectCast(pgControlsNew.SelectedObject, BaseProperties).Size = CurrentControl.Size

View File

@ -7,6 +7,7 @@ Imports DigitalData.Modules.Language.Utils
Imports System.IO
Imports DigitalData.Modules.EDMI.API.DatabaseWithFallback
Imports DigitalData.Modules.EDMI.API.Constants
Imports DevExpress.XtraEditors
Public Class frmMassValidator
Private DTCONTROLS As DataTable
@ -143,9 +144,9 @@ Public Class frmMassValidator
Dim oControl As Control
oLastControl = $"CtrlName {oControlRow.Item("NAME")}, CtrlIndexname: {oControlRow.Item("INDEX_NAME")}"
Select Case oControlRow.Item("CTRL_TYPE").ToString.ToUpper
Case "TXT"
Case ClassControlCreator.PREFIX_TEXTBOX
LOGGER.Debug("Versuch TXT zu laden")
Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(oControlRow, False)
Dim txt As TextEdit = ClassControlCreator.CreateExistingTextbox(oControlRow, False)
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
@ -473,7 +474,7 @@ Public Class frmMassValidator
LOGGER.Debug("INDEX: " & idxname & " - CONTROLNAME: " & oControl.Name & " - LOAD IDXVALUES: " & LoadIDX.ToString)
Dim wertWD
Select Case Type
Case "System.Windows.Forms.TextBox"
Case "DevExpress.XtraEditors.TextEdit"
Try
controltype = "Textbox"
If idxname = "" Then
@ -509,7 +510,7 @@ Public Class frmMassValidator
Case "System.Windows.Forms.ComboBox"
controltype = "ComboBox"
Dim cmb As ComboBox = oControl
Dim cmb As Windows.Forms.ComboBox = oControl
If idxname = "" Then
MsgBox("Achtung fehlerhafte Konfiguration:" & vbNewLine & "Für das Control " & oControl.Name & " wurde KEIN INDEX hinterlegt!" & vbNewLine & "Bitte prüfen Sie den Formulardesigner!", MsgBoxStyle.Critical)
Exit For
@ -838,16 +839,16 @@ Public Class frmMassValidator
End Function
Public Sub OnTextBoxFocus(sender As Object, e As EventArgs)
Dim box As TextBox = sender
Dim box As TextEdit = sender
box.BackColor = Color.LightSteelBlue
box.SelectAll()
End Sub
Public Sub OnTextBoxLostFocus(sender As System.Object, e As System.EventArgs)
Dim box As TextBox = sender
Dim box As TextEdit = sender
box.BackColor = Color.White
End Sub
Public Sub OnTextBoxKeyUp(sender As Object, e As KeyEventArgs)
Dim box As TextBox = sender
Dim box As TextEdit = sender
If box.Text <> String.Empty And me_closing = False And CTRLS_Loaded = True And FORM_Shown = True Then
If (e.KeyCode = Keys.Return) Or (e.KeyCode = Keys.Tab) Or (e.KeyCode = Keys.Enter) Then
@ -908,7 +909,7 @@ Public Class frmMassValidator
If displayboxname.StartsWith(ClassControlCreator.PREFIX_COMBOBOX) Then
LOGGER.Debug("Filling Combobox with Results")
Dim oCombobox As ComboBox = pnldesigner.Controls(displayboxname)
Dim oCombobox As Windows.Forms.ComboBox = pnldesigner.Controls(displayboxname)
If IsNothing(oCombobox) Then
Exit Sub
@ -1097,7 +1098,7 @@ Public Class frmMassValidator
End If
Dim oValue
If TypeOf control Is TextBox Then
If TypeOf control Is TextEdit Then
Try
Dim firstRow As DataRow = dt.Rows(0)
Dim value = firstRow.Item(0)
@ -1108,9 +1109,9 @@ Public Class frmMassValidator
LOGGER.Error(ex)
clsLogger.Add("Error in LoadSimpleData for TextBox: " & ex.Message)
End Try
ElseIf TypeOf control Is ComboBox Then
ElseIf TypeOf control Is Windows.Forms.ComboBox Then
Try
Dim comboxBox As ComboBox = control
Dim comboxBox As Windows.Forms.ComboBox = control
Dim list As New List(Of String)
For Each _row As DataRow In dt.Rows
@ -1223,7 +1224,7 @@ Public Class frmMassValidator
'######
Dim Type As String = oControl.GetType.ToString
Select Case Type
Case "System.Windows.Forms.TextBox"
Case "DevExpress.XtraEditors.TextEdit"
Try
value_from_control = oControl.Text
Catch ex As Exception
@ -1521,7 +1522,7 @@ Public Class frmMassValidator
Catch ex As Exception
LOGGER.Error(ex)
End Try
Case "System.Windows.Forms.TextBox"
Case "DevExpress.XtraEditors.TextEdit"
Try
'Als erstes überprüfen ob überhaupt etwas eingetragen worden ist
If Check_Missing(oControl, "txt") = True And _MUSSEINGABE = True Then 'NICHTS EINGETRAGEN
@ -1742,11 +1743,14 @@ Public Class frmMassValidator
Function Check_Missing(control As Control, typ As String)
Select Case typ
Case "txt"
If control.Text = String.Empty Or control.Text = "(Different values)" Or control.Text = "(Untersch. Werte)" Then
Dim oTextBox As TextEdit = control
If oTextBox.Text = String.Empty Or oTextBox.Text = "(Different values)" Or oTextBox.Text = "(Untersch. Werte)" Then
Return True
End If
Return False
End Select
Return False
End Function
Private Function IndexMultipleFiles(idxxname As String, idxvalue As Object)

View File

@ -19,6 +19,8 @@ Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraBars
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.XtraEditors
Imports DevExpress.Data
Public Class frmValidator
Private Property Current_Document As DocumentResultList.Document = Nothing
@ -741,7 +743,7 @@ Public Class frmValidator
End If
Dim oValue
If TypeOf control Is TextBox Then
If TypeOf control Is TextEdit Then
Try
Dim firstRow As DataRow = oDTContent.Rows(0)
@ -755,7 +757,7 @@ Public Class frmValidator
End Try
ElseIf TypeOf control Is ComboBox Then
Try
Dim oMyComboBox As ComboBox = control
Dim oMyComboBox As Windows.Forms.ComboBox = control
Dim oselectedIndex = oMyComboBox.SelectedIndex
LOGGER.Debug($"oMyComboBox {oMyComboBox.Name} - Saving selected index {oselectedIndex}")
Dim list As New List(Of String)
@ -898,7 +900,7 @@ Public Class frmValidator
oControlInfo = ClassControlCreator.PREFIX_TEXTBOX & "#" & oControlInfo
LOGGER.Debug($"[{oControlInfo}] - TXT Try to create control...")
Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(oControlRow, False)
Dim txt As TextEdit = ClassControlCreator.CreateExistingTextbox(oControlRow, False)
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
@ -1177,7 +1179,7 @@ Public Class frmValidator
For Each inctrl As Control In Me.PanelValidatorControl.Controls
Dim Type As String = inctrl.GetType.ToString
Select Case Type
Case "System.Windows.Forms.TextBox"
Case "DevExpress.XtraEditors.TextEdit"
inctrl.Text = ""
Case "System.Windows.Forms.ComboBox"
Dim cmb As ComboBox = inctrl
@ -1200,20 +1202,25 @@ Public Class frmValidator
End Sub
Public Sub OnTextBoxFocus(sender As Object, e As EventArgs)
Dim oTextbox As TextBox = sender
Dim oTextbox As TextEdit = sender
Dim oMeta As ClassControlCreator.ControlMetadata = oTextbox.Tag
If DirectCast(oTextbox.Tag, ClassControlCreator.ControlMetadata).ReadOnly = False Then
If oMeta.ReadOnly = False Then
oTextbox.BackColor = Color.LightSteelBlue
oTextbox.ForeColor = GraphicsEx.GetContrastedColor(Color.LightSteelBlue)
oTextbox.SelectAll()
End If
End Sub
Public Sub OnTextBoxLostFocus(sender As System.Object, e As System.EventArgs)
Dim oTextbox As TextBox = sender
Dim oTextbox As TextEdit = sender
Dim oMeta As ClassControlCreator.ControlMetadata = oTextbox.Tag
If DirectCast(oTextbox.Tag, ClassControlCreator.ControlMetadata).ReadOnly = False Then
oTextbox.BackColor = Color.White
If oMeta.ReadOnly = False Then
oTextbox.BackColor = oMeta.BackColor
oTextbox.ForeColor = GraphicsEx.GetContrastedColor(oMeta.BackColor)
End If
SetControlValues_FromControl(oTextbox)
ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
@ -1232,7 +1239,7 @@ Public Class frmValidator
Exit Sub
End If
Dim oTextBox As TextBox = sender
Dim oTextBox As TextEdit = sender
If oTextBox.Text <> String.Empty And me_closing = False And _Indexe_Loaded = True And oTextBox.Height < 25 Then
If (e.KeyCode = Keys.Return) Or (e.KeyCode = Keys.Tab) Or (e.KeyCode = Keys.Enter) Then
@ -1668,7 +1675,7 @@ Public Class frmValidator
'End Try
Select Case oControl.GetType()
Case GetType(TextBox)
Case GetType(TextEdit)
If oControlTextOption = "Replace" Then
oControl.Text = oControlCaption
Else
@ -1833,7 +1840,7 @@ Public Class frmValidator
oFound = True
LOGGER.Debug($"Got the depending control ID:{oDEPENDING_GUID}..Setting the values..")
Select Case oControl.GetType.ToString
Case GetType(TextBox).ToString
Case GetType(TextEdit).ToString
Try
Dim oTEXT = oDTDEPENDING_RESULT.Rows(0).Item(0)
Try
@ -1958,7 +1965,7 @@ Public Class frmValidator
oFound = True
LOGGER.Debug($"Got the depending control ID:{oDEPENDING_GUID}..Setting the values..")
Select Case oControl.GetType.ToString
Case GetType(TextBox).ToString
Case GetType(TextEdit).ToString
Try
Dim oTEXT = oDTDEPENDING_RESULT.Rows(0).Item(0)
Try
@ -2336,7 +2343,7 @@ Public Class frmValidator
If displayboxname.StartsWith(ClassControlCreator.PREFIX_COMBOBOX) Then
LOGGER.Debug("Filling Combobox with Results")
Dim oCombobox As ComboBox = PanelValidatorControl.Controls(displayboxname)
Dim oCombobox As Windows.Forms.ComboBox = PanelValidatorControl.Controls(displayboxname)
If IsNothing(oCombobox) Then
Exit Sub
@ -3137,13 +3144,14 @@ Public Class frmValidator
oControName = oControl.Name
Dim oLoadIndex As Boolean = oControlRow.Item("LOAD_IDX_VALUE")
LOGGER.Debug("INDEX: " & oSourceIndexName & " - CONTROLNAME: " & oControl.Name & " - LOAD IDXVALUES: " & oLoadIndex.ToString)
Select Case oType
Case "System.Windows.Forms.TextBox"
Case "DevExpress.XtraEditors.TextEdit"
Try
oControlType = "Textbox"
Dim oTextBox As TextEdit = oControl
Dim oMeta As ClassControlCreator.ControlMetadata = oTextBox.Tag
If oSourceIndexName = "" Then
MsgBox("Attention wrong configuration:" & vbNewLine & "for control " & oControl.Name & " no INDEX configured!" & vbNewLine & "Bitte prüfen Sie den Formulardesigner!", MsgBoxStyle.Critical)
Exit For
@ -3151,7 +3159,7 @@ Public Class frmValidator
If oSourceIndexName Is Nothing = False Then
If oLoadIndex = False Or oSourceIndexName = "DD PM-ONLY FOR DISPLAY" Then
' Wenn kein Index exisitiert, defaultValue laden
oControl.Text = oDefaultValue
oTextBox.EditValue = oDefaultValue
LOGGER.Debug("Indexwert soll nicht geladen werden.")
Exit Select
End If
@ -3186,14 +3194,15 @@ Public Class frmValidator
End If
Try
Dim oFormatString As String = oControlRow.ItemEx("CTRL_FORMAT_STRING", "")
oFormattedValue = ClassFormat.GetFormattedValue(oControl.Name, oValueFromSource, oFormatString)
'Dim oFormatString As String = oControlRow.ItemEx("CTRL_FORMAT_STRING", "")
'oFormattedValue = ClassFormat.GetFormattedValue(oControl.Name, oValueFromSource, oFormatString)
If Not IsNothing(oFormattedValue) And oFormattedValue <> String.Empty Then
oControl.Text = NotNull(oFormattedValue, oDefaultValue)
oTextBox.EditValue = NotNull(oFormattedValue, oDefaultValue)
Else
oControl.Text = NotNull(oValueFromSource, oDefaultValue)
oTextBox.EditValue = NotNull(oValueFromSource, oDefaultValue)
End If
Try
Dim oBackColor As String = oControlRow.Item("CTRL_BACKCOLOR_IF")
If oBackColor <> String.Empty Then
@ -3209,14 +3218,11 @@ Public Class frmValidator
Dim oSQl = $"SELECT CASE WHEN {oExpression} THEN CONVERT(BIT,1) ELSE CONVERT(BIT,0) END "
Dim oColorName = IIf(DatabaseECM.GetScalarValue(oSQl), oSPlit(1), oSPlit(2))
oControl.BackColor = Color.FromName(oColorName)
oMeta.BackColor = oControl.BackColor
oControl.ForeColor = GraphicsEx.GetContrastedColor(oControl.BackColor)
'If oColorName = "Green" Or oColorName = "Blue" Or oColorName = "Red" Then
' oControl.ForeColor = Color.FromName("White")
'Else
' oControl.ForeColor = Color.FromName("Black")
'End If
End If
End If
Catch ex As Exception
@ -3230,7 +3236,7 @@ Public Class frmValidator
Catch ex As Exception
LOGGER.Info("Error While converting defaultValue [" & oDefaultValue & "]: " & ex.Message)
oControl.Text = ""
oTextBox.EditValue = ""
End Try
@ -3248,7 +3254,7 @@ Public Class frmValidator
Case "System.Windows.Forms.ComboBox"
oControlType = "ComboBox"
Dim oMyCombobox As ComboBox = oControl
Dim oMyCombobox As Windows.Forms.ComboBox = oControl
Try
If oSourceIndexName = "" Then
MsgBox("Attention wrong configuration:" & vbNewLine & "for control " & oControl.Name & " no INDEX configured!" & vbNewLine & "Bitte prüfen Sie den Formulardesigner!", MsgBoxStyle.Critical)
@ -4294,7 +4300,7 @@ Public Class frmValidator
'######
Dim Type As String = oControl.GetType.ToString
Select Case Type
Case "System.Windows.Forms.TextBox"
Case "DevExpress.XtraEditors.TextEdit"
Try
value_from_control = oControl.Text
Catch ex As Exception
@ -4450,14 +4456,16 @@ Public Class frmValidator
btnSave.Enabled = True
End Sub
Function Check_Missing(control As Control, typ As String)
Function Check_Missing(control As Control, typ As String) As Boolean
Select Case typ
Case "txt"
If control.Text = String.Empty Then
Dim oTextBox As TextEdit = control
If oTextBox.Text = String.Empty Then
Return True
End If
Return False
End Select
Return False
End Function
Function Return_PM_VEKTOR(input As String, VKTBezeichner As String)
Dim PM_String As String
@ -4774,7 +4782,7 @@ Public Class frmValidator
End Try
Case "System.Windows.Forms.TextBox"
Case "DevExpress.XtraEditors.TextEdit"
Try
'Dim oWrongInputMessage = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("frmValidator.WrongInputControl")
Dim oWrongInputMessage = S.Falsche_Eingabe
@ -4899,7 +4907,7 @@ Public Class frmValidator
Case "System.Windows.Forms.ComboBox"
Try
LOGGER.Debug($"Working on Combobox...")
Dim cmb As ComboBox = oControl
Dim cmb As Windows.Forms.ComboBox = oControl
'Wenn kein Wert ausgewählt wurde und der Index aber gesetzt werden muss
If cmb.SelectedIndex = -1 And oIsRequired = True Then
oMissing = True