View Single Post
  #3 (permalink)  
Old March 26th, 2008, 05:02 PM
dhoyle dhoyle is offline
Registered User
Join Date: Mar 2008
Location: Eads, TN, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Actually I have 2 userControls and 2 classes I use.

UserControl2 has the following code which is launched when the textbox MTB_PkgCount is changed.

Dim PkgCount As Integer = MTB_PkgCount.Text
       If Val(MTB_PkgCount.Text) > 1 Then
                CB_Identical.Visible = True

            Dim myFireAlarm As New FireAlarm()
            Dim myFireHandler As New FireHandlerClass(myFireAlarm, e)
            myFireAlarm.ActivateFireAlarm(PkgCount, e)

It Does reach the function PkgCount_Click located in the UserControl1 and steps through with no error but nothing happens.

The 2 classes are FireAlarm & FireHandler are the following

Public Class FireAlarm
    Delegate Sub PkgCount_Click(ByVal PkgCount As Integer, ByVal e As System.Windows.Forms.KeyEventArgs)
    Public Event FireEvent As PkgCount_Click

    Public Sub ActivateFireAlarm(ByVal PkgCount As Integer, ByVal e As System.Windows.Forms.KeyEventArgs)
        RaiseEvent FireEvent(PkgCount, e)
    End Sub

End Class

Class FireHandlerClass
    Public obj As New force.ucShip2

    Public Sub New(ByVal fireAlarm As FireAlarm, ByVal e As System.Windows.Forms.KeyEventArgs)
        AddHandler fireAlarm.FireEvent, AddressOf obj.PkgCount_Click
    End Sub
End Class

Thanks for your reply!!!

Reply With Quote