471,578 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,578 software developers and data experts.

which mdichild that user joined channel....

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(#visualbasic)... and in second mdichild i got both
responding from both #vb and #visualbasic intot second
mdichild(#visualbasic). 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.ClientFactory.CreateNewChannel
Dim s As String
Dim newFrmChannel As New
PirateChat.ClientFactory.CreateNewChannel(parentWi ndow, s)
Return newFrmChannel
End Function

Namespace PirateChat
Public Class ClientFactory

Public Class CreateNewChannel
Public Sub New(ByVal mparent As mainPirateChat,
ByVal szChannel As String)
End Sub

Shared Sub NewChannel(ByVal szChannel As String)
nChan = New frmChannel
nChan.MdiParent = m_parent
End Sub
End Class

same class1.vb. using with event:
Private Sub _Connection_onNickJoin(ByVal szNick As String, ByVal szHost
As String, ByVal szChannel As String) Handles _Connection.onNickJoin
If szNick <> _Connection.Nick Then
deleg = New OneArgSub(AddressOf DisplayMessage)
deleg.Invoke(nChan.rtbChannel, "<" & szNick & "> " & "["
& szHost & "] " & " has joined " & szChannel, GetUserColours.colourJoin, 1)
nChan.Tag = szTag
nChan.Text = szChannel.ToLower & " [" &
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.CreateNewChannel
Return mainWin.NewChannel()
End Function 'CreateChannel

Private Sub txtStatus_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtStatus.KeyPress
Dim mparent As mainPirateChat
If Asc(e.KeyChar) = 13 Then
'Dim intI As String = CType(CLi.IndexOf(Nick), Integer)
Dim s As String = txtStatus.Text.Substring(0, 4)
If s = "join" Then
szTag = txtStatus.Text.Substring(5)
End If

Debug.WriteLine("sztag :" & szTag)
Netsock.SendData(Netsock.StringToBytes(txtStatus.T ext &
txtStatus.Text = String.Empty
End If
End Sub
does ne 1 have better ideas which channel on which mdichild?
Nov 21 '05 #1
0 1140

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Supra | last post: by
3 posts views Thread by Bill English | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.