Feature Walkthrough
Before you learn how to write the chat application in this article, I'll do a walkthrough of its features.
When you log in to the server, a list of online users will be shown on the ListBox (see the left of Figure 1).

Figure 1. Logging In: The server will display a list of logged in users in the left frame.
|
|

Figure 2. Chatting with One User: The image shows the beginning of a chat between two users. |
To chat with a user, simply select the user you want to chat with, type your message, and click the Send button to send the message (see
Figure 2).
To chat with multiple users, control-click on the users’ names in the ListBox control (see Figure 3).

Figure 3. Chatting with Multiple Users: The image shows a third user brought into the chat.
|
|

Figure 4. Sending a File: Users browse for the file they wish to send to another user. |
To send a file to another user, select the recipient’s name and click on the Send File button. Then select the file you want to send and click Open (see
Figure 4).
The recipient will receive a prompt requesting to download the file. If he clicks Yes, the file is downloaded (see Figure 5).

Figure 5. Prompting for Download: A dialog gives the file recipient the opportunity to accept or deny the file download.
|
|

Figure 6. Making Progress: File recipients can see how much of the file has downloaded until the download is complete. |
As the file is downloaded, the status bar will display the number of bytes received (see
Figure 6).