FileFlow/Global_Indexer/ClassControls.vb
2018-11-07 10:54:02 +01:00

33 lines
1.0 KiB
VB.net

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)
chk.Location = New Point(11, y)
If caption <> "" Then
chk.Text = caption
chk.Size = New Size(CInt(caption.Length * 15), 27)
End If
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 = value
End If
Return chk
Catch ex As Exception
ClassLogger.Add("Unhandled Exception in AddCheckBox: " & ex.Message, True)
Return Nothing
End Try
End Function
End Class