Files
AVISO/Aviso/Benutzerdefinierte Elemente/usrcntlCheckBox.vb

52 lines
1.7 KiB
VB.net

Public Class usrcntlCheckBox
Property value = ""
' Public Property _beteiligter As String = ""
Public Property _abrArt As String = ""
Public Property _beteiligter As String = ""
Public Property _readOnly As Boolean = False
Event ValueChanged(value)
Event CLICKED(sender As usrcntlCheckBox)
Private Sub MyTextCheckBox_Click(sender As Object, e As EventArgs) Handles Me.Click, lbl.Click
If _readOnly Then RaiseEvent CLICKED(Me) : Exit Sub
Dim small As New Font(lbl.Font.FontFamily, 5)
Dim big As New Font(lbl.Font.FontFamily, 8.25)
Me.Font = big
Select Case lbl.Text
Case "" : lbl.Text = "X"
Case "X" : lbl.Text = "" ' lbl.Text = "BAR" : lbl.Font = small
' Case "BAR" : lbl.Text = ""
End Select
RaiseEvent ValueChanged(value)
End Sub
Private Sub lbl_TextChanged(sender As Object, e As EventArgs) Handles lbl.TextChanged
If _readOnly Then Exit Sub
Dim small As New Font(lbl.Font.FontFamily, 5)
Dim big As New Font(lbl.Font.FontFamily, 8.25)
value = lbl.Text
lbl.Font = IIf(lbl.Text = "BAR", small, big)
lbl.BackColor = If(lbl.Text <> "", Color.SandyBrown, Color.White)
End Sub
Public Sub special(setValue As Boolean)
If setValue Then
lbl.BackColor = Color.SandyBrown
lbl.Font = New Font(Me.Font.FontFamily, 5, FontStyle.Bold)
'lbl.ForeColor = Color.White
lbl.Text = "JA"
Else
lbl.BackColor = Color.White
' lbl.ForeColor = Color.Black
lbl.Text = ""
End If
End Sub
End Class