Files
tcpipSocket/Chat/Client/ChatRoomForm.cs

38 lines
666 B
C#
Raw Normal View History

2023-02-08 16:31:22 +09:00
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;
}
}
}