MDIchild problem: IRC client.

NPToita

New member
Joined
Mar 3, 2005
Messages
3
Programming Experience
3-5
First of I'm going to list of the main controls and forms needed in my project.
I have a class called IrcClient with a couple of events. A MDI parent form called frmIRC, A form called frmServer which has a myClient variable of the IRC class declared withevents, and a form called frmChan.

Basically first of the MDI parent will load up with load event with codes as follows:

***************************************
*Codes in frmIRC **
***************************************
Private Sub newServer()
Dim myWindow As New frmServer
myWindow.MdiParent = Me
myWindow.Show()
End Sub

Private Sub frmIRC_Load(ByVal sender As System.Object, ByVal e As system.EventArgs) Handles MyBase.Load
newServer()
End Sub

**************************************
*Codes in frmServer **
**************************************
Public WithEvents myClient As New IrcClient

Private Sub frmServer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
myClient.Connect("irc.efnet.net", 6667)
End Sub

Private Sub myClient_onJoin(ByVal sNick As String, ByVal sChannel As String, ByVal sNow As String) Handles myClient.onJoin
dim myChan as new frmChan
myChan.name = sChannel
mychan.text = sChannel
mychan.mdiparent = me.mdiparent
mychan.show()
End Sub

but when myClient_onJoin event happens, the new mdichild window does show up.

I tried test my some piece of in the onJoin event with a button added to frmServer and have the click event to run the same codes and it works just fine. any one know what might have caused this?

 

Latest posts

Top Bottom