2 Begin VB.Form ChatWindow
21 Begin VB.CommandButton list_button
22 Caption = "&List chat users"
29 Begin VB.CommandButton quit_button
30 Caption = "Exit Chat Mode"
37 Begin VB.Timer ChatRefresh
42 Begin VB.TextBox Outgoing
50 Begin VB.TextBox Incoming
52 name = "MS Sans Serif"
58 strikethrough = 0 'False
69 Attribute VB_Name = "ChatWindow"
70 Attribute VB_Creatable = False
71 Attribute VB_Exposed = False
75 Private Sub ChatRefresh_Timer()
78 If InStr(TCPinbuf$, Chr$(10)) > 0 Then
81 ChatRefresh.Enabled = False
94 ThisUser$ = Left$(a$, p - 1)
95 a$ = Right$(a$, Len(a$) - p)
96 If a$ = "NOOP" Then GoTo Top
97 If (ThisUser$ <> LastUser$) Then
98 Incoming.Text = Incoming.Text + Chr$(13) + Chr$(10) + ThisUser$ + ":"
101 Incoming.Text = Incoming.Text + a$ + Chr$(13) + Chr$(10)
103 ' Count the lines and strip down to 28
105 For b = 1 To Len(Incoming.Text)
106 If Mid$(Incoming.Text, b, 1) = Chr$(13) Then nl = nl + 1
109 np = InStr(Incoming.Text, Chr$(13))
110 Incoming.Text = Right$(Incoming.Text, Len(Incoming.Text) - np - 2)
118 ChatRefresh.Interval = 2000
119 ChatRefresh.Enabled = True
121 TheEnd: Rem - go here when done
126 Private Sub Form_Load()
128 MainWin.MousePointer = 0
139 Private Sub Form_Resize()
143 ChatWindow.Width = MainWin.Width - 200
144 ChatWindow.Height = MainWin.Height - 450
147 Incoming.Width = ChatWindow.Width - 200
149 Incoming.Height = ChatWindow.Height - 1200
152 Outgoing.Width = ChatWindow.Width - 200
153 Outgoing.Top = ChatWindow.Height - 1100
154 Outgoing.Height = 400
156 quit_button.Top = ChatWindow.Height - 100 - quit_button.Height
157 quit_button.Left = ChatWindow.Width - 100 - quit_button.Width
158 list_button.Top = quit_button.Top
159 list_button.Left = quit_button.Left - quit_button.Width - 100
164 Private Sub list_button_Click()
170 Private Sub Outgoing_Change()
172 a = InStr(Outgoing.Text, Chr$(13) + Chr$(10))
174 serv_puts (Left$(Outgoing.Text, a - 1))
175 Outgoing.Text = Right$(Outgoing.Text, Len(Outgoing.Text) - a - 1)
178 If (Len(Outgoing.Text) > 55) Or (Len(Outgoing.Text) > 48 And Right$(Outgoing.Text, 1) = " ") Then
179 serv_puts (Outgoing.Text)
186 Private Sub quit_button_Click()