2009/01/23(Fri) 10:00:56 編集(投稿者)
皆さん、ありがとうございます
一応以下のコードで出来ました
Private _A As Boolean = False
Private _B As Boolean = True
Private _A_Old As Boolean = False
Private _B_Old As Boolean = True
Private _KBN_INT As Integer = 0
Public Event AChanged(ByVal sender As Object, ByVal e As EventArgs)
Public Event BChanged(ByVal sender As Object, ByVal e As EventArgs)
<System.ComponentModel.DefaultValue(False)> Public Property A() As Boolean
Get
Return _A
End Get
Set(ByVal value As Boolean)
_A = value
If _A <> _A_Old AndAlso _KBN_INT = 0 Then
_A_Old = _A
_KBN_INT += 1
RaiseEvent AChanged(Me, New EventArgs)
Else
_A_Old = _A
_KBN_INT = 0
Exit Property
End If
End Set
End Property
<System.ComponentModel.DefaultValue(False)> Public Property B() As Boolean
Get
Return _B
End Get
Set(ByVal value As Boolean)
_B = value
If _B <> _B_Old AndAlso _KBN_INT = 0 Then
_B_Old = _B
_KBN_INT += 1
RaiseEvent BChanged(Me, New EventArgs)
Else
_B_Old = _B
_KBN_INT = 0
Exit Property
End If
End Set
End Property
Private Sub Class2_AChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.AChanged
Me.B = Not _A
End Sub
Private Sub Class2_BChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.BChanged
Me.A = Not _B
End Sub
他の解決法などがあればアドバイスお願いします