client base
This commit is contained in:
37
Chat/Client/ChatRoomForm.cs
Normal file
37
Chat/Client/ChatRoomForm.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Client
|
||||
{
|
||||
public partial class ChatRoomForm : Form
|
||||
{
|
||||
public ChatRoomForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btmSend_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(tbxMsg.Text))
|
||||
return;
|
||||
|
||||
lbxMsg.Items.Add(tbxMsg.Text);
|
||||
tbxMsg.Text = null;
|
||||
|
||||
ScrollMsgToEnd();
|
||||
}
|
||||
|
||||
private void ScrollMsgToEnd()
|
||||
{
|
||||
lbxMsg.SelectedIndex = lbxMsg.Items.Count - 1;
|
||||
lbxMsg.SelectedIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user