|
-
Mar 19th, 2005, 08:09 PM
#1
Thread Starter
Addicted Member
My chat server + client
ok first for my client.
I have everything made i was just wondering how after a set amount of lines the chat will clear OR once the text reaches the bottom it keep scrolling down.
Now for my server.
Everything is made but i wanna make it so that it displays the current online users. i have the thing that adds 1 to the count but i dunno how to minus one when someone disconnects.I also wanna make it so that after someoen disconnects the winsock array is closed.... anyone got any ideas how to do that?
Thanks for your help,
David
-
Mar 19th, 2005, 09:17 PM
#2
Hyperactive Member
Re: My chat server + client
Well for your client you can use:
Code:
Private Sub Text1_Change()
With Text1
.SelStart = Len(.Text) + 1
End With
End Sub
But Im not so positive on the server part.
If my post was helpful please rate it 
-
Mar 19th, 2005, 09:19 PM
#3
Thread Starter
Addicted Member
Re: My chat server + client
i use a list will that still work?
EDIT
nope it didn't work with List1 i changed the Text1 to List1's if ur wondering lol
-
Mar 19th, 2005, 09:34 PM
#4
Hyperactive Member
Re: My chat server + client
Oh, didnt know you where using a Listbox, try this.. Add a timer and put this in it. Use a interval of about 500 (You can change it if needed).
Code:
Private Sub Timer1_Timer()
With List1
.ListIndex = .ListCount - 1
End With
End Sub
If my post was helpful please rate it 
-
Mar 19th, 2005, 09:44 PM
#5
Thread Starter
Addicted Member
Re: My chat server + client
ok that worked thx
-
Mar 20th, 2005, 04:50 PM
#6
Hyperactive Member
Re: My chat server + client
Well on your server you can also have like a label for the users.
Code:
Dim i as long
Private Sub Form_Load()
Label1.Caption = "Online Users :: 0"
i = 0
End Sub
Like that. Then in the Socket_ConnectionRequest put something like
Code:
i = i + 1
With Label1
.Caption = "Online Users :: " & i
End With
And in the Socket_Close sub put something like
Code:
i = i - 1
With Label1
.Caption = "Online Users :: " & i
End With
Now this may now work to good because clients with sockets can have multiple connects to the server. So it may count the same connection twice because of sockets. But thats the general idea of it.
If my post was helpful please rate it 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|