jj: fix default value of checkbox
This commit is contained in:
parent
5e58e94e33
commit
e48739fcf9
@ -1,6 +1,7 @@
|
||||
Public Class ClassControls
|
||||
Public Shared Function AddCheckBox(indexname As String, y As Integer, vorbelegung As String, caption As String)
|
||||
Try
|
||||
Dim value As Boolean = False
|
||||
Dim chk As New CheckBox
|
||||
chk.Name = "chk" & indexname
|
||||
chk.Size = New Size(100, 27)
|
||||
@ -10,15 +11,17 @@
|
||||
chk.Text = caption
|
||||
chk.Size = New Size(CInt(caption.Length * 15), 27)
|
||||
End If
|
||||
If vorbelegung <> "" Then
|
||||
|
||||
If Boolean.TryParse(vorbelegung, value) = False Then
|
||||
If vorbelegung = "1" Or vorbelegung = "0" Then
|
||||
chk.Checked = CBool(vorbelegung)
|
||||
Else
|
||||
chk.Checked = False
|
||||
End If
|
||||
Else
|
||||
chk.Checked = False
|
||||
chk.Checked = value
|
||||
End If
|
||||
|
||||
Return chk
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unhandled Exception in AddCheckBox: " & ex.Message, True)
|
||||
|
||||
@ -2122,9 +2122,8 @@ Public Class frmIndex
|
||||
End If
|
||||
Select Case type
|
||||
Case "BOOLEAN"
|
||||
Dim VORBELGUNG As Integer = DefaultValue
|
||||
'nur eine Textbox
|
||||
Dim chk As CheckBox = ClassControls.AddCheckBox(DR.Item("NAME"), y, VORBELGUNG, DR.Item("COMMENT").ToString)
|
||||
Dim chk As CheckBox = ClassControls.AddCheckBox(DR.Item("NAME"), y, DefaultValue, DR.Item("COMMENT").ToString)
|
||||
If Not IsNothing(chk) Then
|
||||
pnlIndex.Controls.Add(chk)
|
||||
End If
|
||||
@ -2262,7 +2261,6 @@ Public Class frmIndex
|
||||
Dim manIndexwert = GetManIndex_Value(elementOhneSonderzeichen, "IDX_AUTO", optionalIndex)
|
||||
If Not IsNothing(manIndexwert) Then
|
||||
SqlString = SqlString.Replace(element.Value, manIndexwert)
|
||||
|
||||
Else
|
||||
ClassLogger.Add(">> Attention: manIndexwert is NOTHING - Funktion: FillIndexe_Autom", False)
|
||||
' Return False
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user