FormatString Currency

This commit is contained in:
Developer01 2025-08-15 15:07:24 +02:00
parent ffa65a9c07
commit 642e65c95b
3 changed files with 16 additions and 13 deletions

View File

@ -329,13 +329,11 @@ Public Class ClassControlCreator
' 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
If oFormatString <> String.Empty And oReadOnly = False Then
oControl.Properties.DisplayFormat.FormatType = FormatType.Custom
oControl.Properties.DisplayFormat.FormatString = ClassFormat.GetFormatString(oFormatString)
End If
ElseIf oReadOnly Then
' 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

View File

@ -187,7 +187,8 @@ Public Class ClassPMWindream
Case WMObjectVariableValueTypeFloat
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFloat")
Try
convertValue = CDbl(value)
value = Replace(value, ".", ",")
convertValue = Convert.ToDouble(value)
Catch ex As Exception
LOGGER.Error(ex)
frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!"
@ -295,10 +296,11 @@ Public Class ClassPMWindream
'ReDim ArrName(0)
'ArrName(0) = "Tournr"
'oDocument.SetValues(ArrName, ArrValues)
If convertValue = "String.Empty" Or convertValue = vbEmpty Then
LOGGER.Debug("Now Indexing simpleAttribute with vbEmpty ...")
oDocument.SetVariableValue(aName, String.Empty)
ElseIf _int = True Then
'If convertValue = String.Empty Or convertValue = vbEmpty Then
' LOGGER.Debug("Now Indexing simpleAttribute with vbEmpty ...")
' oDocument.SetVariableValue(aName, String.Empty)
'Else
If _int = True Then
oDocument.SetVariableValue(aName, CInt(convertValue))
ElseIf _date = True Then
oDocument.SetVariableValue(aName, CDate(convertValue))

View File

@ -72,7 +72,7 @@ Public Class frmValidator
Private Property Move2Folder As String
'Private Property DataASorDB As ClassDataASorDB
Private Property allgFunk As New ClassAllgemeineFunktionen
Private CountAction As Int16 = 0
Public Shared Property WMDocPathWindows As String
Private Property DocPathWindows As String
'Anzahl der Validierungsdokumente
@ -1228,9 +1228,10 @@ Public Class frmValidator
End Sub
Public Sub OnTextBoxFocus(sender As Object, e As EventArgs)
CountAction += 1
Dim oTextbox As BaseEdit = sender
Dim oMeta As ClassControlCreator.ControlMetadata = oTextbox.Tag
Console.WriteLine($"[{CountAction}] OnFocus {oMeta.Name}")
If oMeta.ReadOnly = False Then
oTextbox.BackColor = Color.LightSteelBlue
oTextbox.ForeColor = GraphicsEx.GetContrastedColor(Color.LightSteelBlue)
@ -1239,9 +1240,11 @@ Public Class frmValidator
End Sub
Public Sub OnTextBoxLostFocus(sender As System.Object, e As System.EventArgs)
CountAction += 1
Dim oTextbox As BaseEdit = sender
Dim oMeta As ClassControlCreator.ControlMetadata = oTextbox.Tag
Console.WriteLine($"[{CountAction}] LostFocus {oMeta.Name}")
Console.WriteLine(oTextbox.Properties.DisplayFormat.FormatString)
If oMeta.ReadOnly = False Then
oTextbox.BackColor = oMeta.BackColor
oTextbox.ForeColor = GraphicsEx.GetContrastedColor(oMeta.BackColor)