public void addOutMessage(string message, string time) { bubble bbl = new Whatsapp_Bunifu_UI.bubble(message, time, msgtype.Out); bbl.Location = bubble1.Location; bbl.Left += 20; //add intent bbl.Size = bubble1.Size; bbl.Anchor = bubble1.Anchor; bbl.Top = bbl_old.Bottom + 10; panel2.Controls.Add(bbl); bottom.Top = bbl.Bottom + 50; bbl_old = bbl; //safe the last added object }
public void addInMessage(string message, string time) { bubble bbl = new Whatsapp_Bunifu_UI.bubble(message, time, msgtype.In); bbl.Location = bubble1.Location; bbl.Size = bubble1.Size; bbl.Anchor = bubble1.Anchor; bbl.Top = bbl_old.Bottom + 10; panel2.Controls.Add(bbl); panel2.VerticalScroll.Value = panel2.VerticalScroll.Maximum; bbl_old = bbl; //safe the last added object }