From a9cc02c4b458b17131cf81204cbec4416673c5dc Mon Sep 17 00:00:00 2001 From: Developer01 Date: Tue, 19 Aug 2025 13:34:55 +0200 Subject: [PATCH] @@Display Only wie ReadOnly behandeln Try1 --- app/TaskFlow/ClassControlCreator.vb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/app/TaskFlow/ClassControlCreator.vb b/app/TaskFlow/ClassControlCreator.vb index 5e02999..40d09f5 100644 --- a/app/TaskFlow/ClassControlCreator.vb +++ b/app/TaskFlow/ClassControlCreator.vb @@ -110,17 +110,22 @@ Public Class ClassControlCreator Dim family As FontFamily = New FontFamily(familyString) Dim oGuid As Integer = row.Item("GUID") - Dim oName As String = NotNull(row.Item("NAME"), "") + Dim oControlName As String = NotNull(row.Item("NAME"), "") Dim oAttribute As String = NotNull(row.Item("INDEX_NAME"), "") Dim oLocation As New Point(x, y) Dim oFont As New Font(family, size, style, GraphicsUnit.Point) Dim oColor As Color = IntToColor(NotNull(row.Item("FONT_COLOR"), DEFAULT_COLOR)) Dim oReadOnly As Boolean = row.Item("READ_ONLY") Dim oAddNewItems As Boolean = row.Item("VKT_ADD_ITEM") + If oAttribute = "@@DISPLAY_ONLY" And oReadOnly = False Then + Logger.Info($"Override oReadOnly = True for Control [{oControlName}] as Attribute is @@DISPLAY_ONLY and ReadOnly = False") + oReadOnly = True + End If + Return New ControlDBProps() With { .Guid = oGuid, - .Name = oName, + .Name = oControlName, .Attribute = oAttribute, .Location = oLocation, .Font = oFont, @@ -305,9 +310,8 @@ Public Class ClassControlCreator Dim oReadOnly = oControlRow.ItemEx("READ_ONLY", False) Dim oFormatString = oControlRow.ItemEx("FORMAT_STRING", String.Empty) Dim oBackColorIf = oControlRow.ItemEx("CTRL_BACKCOLOR_IF", String.Empty) - + Dim oIndexname = oControlRow.ItemEx("INDEX_NAME", String.Empty) Dim oControl As BaseEdit = Nothing - If oHeight >= 27 Then oControl = CreateBaseControl(New MemoEdit(), oControlRow, designMode) Else @@ -323,19 +327,19 @@ Public Class ClassControlCreator oControl.Width = oWidth If Not designMode Then - oControl.ReadOnly = oReadOnly + '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 And oReadOnly = False Then + If oFormatString <> String.Empty Then oControl.Properties.DisplayFormat.FormatType = FormatType.Custom oControl.Properties.DisplayFormat.FormatString = ClassFormat.GetFormatString(oFormatString) - ElseIf oReadOnly Then - ' For read only controls, don't show the raw value when a user clicks into it - oControl.Properties.EditFormat.FormatType = FormatType.Custom - oControl.Properties.EditFormat.FormatString = ClassFormat.GetFormatString(oFormatString) + 'ElseIf oReadOnly Then + ' ' For read only controls, don't show the raw value when a user clicks into it + ' oControl.Properties.EditFormat.FormatType = FormatType.Custom + ' oControl.Properties.EditFormat.FormatString = ClassFormat.GetFormatString(oFormatString) End If Else oControl.ReadOnly = True