jj: fix default value of checkbox
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user