public main() { InitializeComponent(); schedulerControl1.Start = DateTime.Now; //MainWindow MainWindow = new MainWindow(); //MainWindow.Show(); var bubble = new MeBubble(); bubble.Name = "chatItem" + itemsPanel.Controls.Count; bubble.Dock = DockStyle.Top; itemsPanel.Controls.Add(bubble); bubble.BringToFront(); bubble.Body = "مرحبا"; //itemsPanel.ScrollControlIntoView(bubble); }
private void FakeRecieving(string message) { var bubble = new MeBubble(); bubble.Name = "chatItem" + itemsPanel.Controls.Count; bubble.Dock = DockStyle.Top; itemsPanel.Controls.Add(bubble); bubble.BringToFront(); if (message == "السلام عليكم ") { bubble.Body = "وعليكم السلام"; } else { bubble.Body = "This is a message received."; } //bubble.Focus(); itemsPanel.ScrollControlIntoView(bubble); //FakeRecieving(); }