Example #1
0
        public void addInMessage(string kkMessage, int message_type = 0, string urlPic = "", string urlSticker = "", string kkTime = "")
        {
            bubble bbl = new Internal_Society.bubble(kkMessage, urlPic, urlSticker, message_type, kkTime, msgType.In);

            //Xét xem scroll bar tồn tại hay chưa
            if (panel2.VerticalScroll.Visible == false)
            {
                bbl.Location = new Point(this.Width - bbl.Width - 40, 50);
            }
            else
            {
                bbl.Location = new Point(this.Width - bbl.Width - 55, 50);
            }

            bbl.Top    = bbl_old.Bottom + 20;
            bbl.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
            panel2.Controls.Add(bbl);
            panel2.VerticalScroll.Value = panel2.VerticalScroll.Maximum;
            bbl_old = bbl;
            if (Panel_Color_Bubble.isChangedColor == true)
            {
                foreach (Control x in panel2.Controls)
                {
                    if (x is bubble)
                    {
                        ((bubble)x).ChangeColorBubble();
                        Panel_Color_Bubble.isChangedColor = false;
                    }
                }
            }
        }
Example #2
0
        public void addOutMessage(string kkMessage, int message_type = 0, string urlPic = "", string urlSticker = "", string kkTime = "")
        {
            bubble     bbl = new Internal_Society.bubble(kkMessage, urlPic, urlSticker, message_type, kkTime, msgType.Out);
            PictureBox pic = new PictureBox();

            pic.Size          = new Size(40, 40);
            pic.SizeMode      = PictureBoxSizeMode.Zoom;
            bbl.Anchor        = (AnchorStyles.Top | AnchorStyles.Left);
            pic.Anchor        = (AnchorStyles.Top | AnchorStyles.Left);
            bbl.Location      = new Point(90, 50);
            bbl.Top           = bbl_old.Bottom + 20;
            pic.Location      = new Point(20, bbl.Top);
            pic.ImageLocation = "../../Resources/user_001.png";
            panel2.Controls.Add(pic);
            panel2.Controls.Add(bbl);
            panel2.VerticalScroll.Value = panel2.VerticalScroll.Maximum;
            bbl_old = bbl;
        }