public void addOutMessage(string message, string time) { chatmesg bbl = new chat_list.chatmesg(message, time, msgtype.Out); bbl.Location = bubble1.Location; bbl.Left += 20; bbl.Size = bubble1.Size; bbl.Anchor = bubble1.Anchor; bbl.Top = bbl_old.Bottom + 10; //curtop = bbl.Bottom + 10; panel5.Controls.Add(bbl); panel5.VerticalScroll.Value = panel5.VerticalScroll.Maximum; bbl_old = bbl; // safe the last added object }
//------------------------------------------------------------------------------------------------------------------ // display received picture/file public void addInPicture(string message) { chatmesg bbl = new chat_list.chatmesg(message, msgtype.In); //message = "https://www.w3schools.com/css/img_fjords.jpg"; bbl.setimage(message); //while (bbl.p) bbl.Location = bubble1.Location; bbl.Size = bubble1.Size; bbl.Anchor = bubble1.Anchor; //if (bbl.Location != bubble1.Location) bbl.Top = bbl_old.Bottom + 10; //curtop = bbl.Bottom + 10; panel5.Controls.Add(bbl); panel5.VerticalScroll.Value = panel5.VerticalScroll.Maximum; bbl_old = bbl;// safe the last added object }