i got mdichild working. i'm working on similar to mirc chat. when i
joined channel #vb the first mdichild is on. then when i wanted to join
another channel #visualbasic. then i got second mdichild on. the first
mdichild(#vb) is stopped responding and all #vb goes into combination
of second mdichild(#visua lbasic)... and in second mdichild i got both
responding from both #vb and #visualbasic intot second
mdichild(#visua lbasic). but how do i get the first #vb goes into first
mdichild and secondly #visualbasic goes into second mdichild. if user
joined #vb that goes to first mdichild and if user joined #visaulbasic
that go to second mdichild all times.
in main form:
Shared Function NewChannel() As PirateChat.Clie ntFactory.Creat eNewChannel
Dim s As String
Dim newFrmChannel As New
PirateChat.Clie ntFactory.Creat eNewChannel(par entWindow, s)
Return newFrmChannel
End Function
class1.vb:
Namespace PirateChat
Public Class ClientFactory
\\
\\
Public Class CreateNewChanne l
Public Sub New(ByVal mparent As mainPirateChat,
ByVal szChannel As String)
NewChannel(szCh annel)
End Sub
Shared Sub NewChannel(ByVa l szChannel As String)
nChan = New frmChannel
nChan.MdiParent = m_parent
nChan.Show()
End Sub
End Class
same class1.vb. using with event:
Private Sub _Connection_onN ickJoin(ByVal szNick As String, ByVal szHost
As String, ByVal szChannel As String) Handles _Connection.onN ickJoin
If szNick <> _Connection.Nic k Then
deleg = New OneArgSub(Addre ssOf DisplayMessage)
deleg.Invoke(nC han.rtbChannel, "<" & szNick & "> " & "["
& szHost & "] " & " has joined " & szChannel, GetUserColours. colourJoin, 1)
nChan.lstNames. Items.Add(szNic k)
nChan.Tag = szTag
nChan.Text = szChannel.ToLow er & " [" &
nChan.lstNames. Items.Count - 1 & "]"
Debug.WriteLine ("joined :" & nChan.Tag)
End If
End Sub
and in frmStatus:
'Creates a new joined Channel
Function CreateChannel() As ClientFactory.C reateNewChannel
Return mainWin.NewChan nel()
End Function 'CreateChannel
Private Sub txtStatus_KeyPr ess(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyPressE ventArgs) Handles txtStatus.KeyPr ess
Dim mparent As mainPirateChat
If Asc(e.KeyChar) = 13 Then
'Dim intI As String = CType(CLi.Index Of(Nick), Integer)
Dim s As String = txtStatus.Text. Substring(0, 4)
If s = "join" Then
CreateChannel()
szTag = txtStatus.Text. Substring(5)
End If
Debug.WriteLine ("sztag :" & szTag)
Netsock.SendDat a(Netsock.Strin gToBytes(txtSta tus.Text &
vbCrLf))
txtStatus.Text = String.Empty
txtStatus.Selec tAll()
rtbStatus.Focus ()
End If
End Sub
does ne 1 have better ideas which channel on which mdichild?
joined channel #vb the first mdichild is on. then when i wanted to join
another channel #visualbasic. then i got second mdichild on. the first
mdichild(#vb) is stopped responding and all #vb goes into combination
of second mdichild(#visua lbasic)... and in second mdichild i got both
responding from both #vb and #visualbasic intot second
mdichild(#visua lbasic). but how do i get the first #vb goes into first
mdichild and secondly #visualbasic goes into second mdichild. if user
joined #vb that goes to first mdichild and if user joined #visaulbasic
that go to second mdichild all times.
in main form:
Shared Function NewChannel() As PirateChat.Clie ntFactory.Creat eNewChannel
Dim s As String
Dim newFrmChannel As New
PirateChat.Clie ntFactory.Creat eNewChannel(par entWindow, s)
Return newFrmChannel
End Function
class1.vb:
Namespace PirateChat
Public Class ClientFactory
\\
\\
Public Class CreateNewChanne l
Public Sub New(ByVal mparent As mainPirateChat,
ByVal szChannel As String)
NewChannel(szCh annel)
End Sub
Shared Sub NewChannel(ByVa l szChannel As String)
nChan = New frmChannel
nChan.MdiParent = m_parent
nChan.Show()
End Sub
End Class
same class1.vb. using with event:
Private Sub _Connection_onN ickJoin(ByVal szNick As String, ByVal szHost
As String, ByVal szChannel As String) Handles _Connection.onN ickJoin
If szNick <> _Connection.Nic k Then
deleg = New OneArgSub(Addre ssOf DisplayMessage)
deleg.Invoke(nC han.rtbChannel, "<" & szNick & "> " & "["
& szHost & "] " & " has joined " & szChannel, GetUserColours. colourJoin, 1)
nChan.lstNames. Items.Add(szNic k)
nChan.Tag = szTag
nChan.Text = szChannel.ToLow er & " [" &
nChan.lstNames. Items.Count - 1 & "]"
Debug.WriteLine ("joined :" & nChan.Tag)
End If
End Sub
and in frmStatus:
'Creates a new joined Channel
Function CreateChannel() As ClientFactory.C reateNewChannel
Return mainWin.NewChan nel()
End Function 'CreateChannel
Private Sub txtStatus_KeyPr ess(ByVal sender As Object, ByVal e As
System.Windows. Forms.KeyPressE ventArgs) Handles txtStatus.KeyPr ess
Dim mparent As mainPirateChat
If Asc(e.KeyChar) = 13 Then
'Dim intI As String = CType(CLi.Index Of(Nick), Integer)
Dim s As String = txtStatus.Text. Substring(0, 4)
If s = "join" Then
CreateChannel()
szTag = txtStatus.Text. Substring(5)
End If
Debug.WriteLine ("sztag :" & szTag)
Netsock.SendDat a(Netsock.Strin gToBytes(txtSta tus.Text &
vbCrLf))
txtStatus.Text = String.Empty
txtStatus.Selec tAll()
rtbStatus.Focus ()
End If
End Sub
does ne 1 have better ideas which channel on which mdichild?