//Add message to listbox void addMsg(CUser user) { rtbMessage.SelectionFont = new Font(new FontFamily(user.fontFamily), user.size); rtbMessage.SelectionColor = user._color; rtbMessage.AppendText(user.nickname + ":" + user.message + Environment.NewLine); rtbMessage.ScrollToCaret(); txbMessage.Clear(); }
public Client(CUser a) { InitializeComponent(); //Use info user this.user = a; //Connect to server Connect(); //Load font to combobox LoadFont(); }
void Receive() { try { while (true) { byte[] data = new byte[1024 * 5000]; client.Receive(data); CUser infoUser = (CUser)Deserialize(data); addMsg(infoUser); } } catch { Close(); } }