Imports System.ComponentModel
Imports System.Windows.Forms

Public Class MyCheckbox
    Inherits CheckBox
    Implements INotifyPropertyChanged

    Property _value As String = ""
    Property Checked_value As Boolean = False

    ' Protected Overrides Sub OnCheckedChanged(ByVal e As EventArgs)
    '     Me.Checked = Me.Checked_value
    '  End Sub

    Private Sub MyCheckbox_Click(sender As Object, e As EventArgs) Handles Me.Click
        Me.Checked = Me.Checked_value
    End Sub

    Public Property CheckedValue As Boolean
        Get
            Return Checked_value
        End Get
        Set(v As Boolean)
            Checked_value = v
            Me.Checked = Checked_value
            OnPropertyChanged("CheckedValue")
        End Set
    End Property



    Public Event PropertyChanged As PropertyChangedEventHandler _
      Implements INotifyPropertyChanged.PropertyChanged

    Protected Sub OnPropertyChanged(ByVal name As String)
        RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(name))
    End Sub



End Class