38 lines
666 B
C#
38 lines
666 B
C#
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|