Beispiel #1
0
        //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();
        }
Beispiel #2
0
        public Client(CUser a)
        {
            InitializeComponent();
            //Use info user
            this.user = a;



            //Connect to server
            Connect();
            //Load font to combobox
            LoadFont();
        }
Beispiel #3
0
        void Receive()
        {
            try
            {
                while (true)
                {
                    byte[] data = new byte[1024 * 5000];
                    client.Receive(data);

                    CUser infoUser = (CUser)Deserialize(data);
                    addMsg(infoUser);
                }
            }
            catch
            {
                Close();
            }
        }