Пример #1
0
        // Bot Message Bubble Creation
        public void addOutMessage(string message)
        {
            // Create new chat bubble
            bubble bbl = new bubble(message, msgtype.Out);

            bbl.Location = bubble1.Location;    // Set the new bubble location from the bubble sample.
            bbl.Size     = bubble1.Size;        // Set the new bubble size from the bubble sample.
            bbl.Top      = bbl_old.Bottom + 10; // Position the bubble below the previous one with some extra space.

            // Add the new bubble to the panel.
            panel2.Controls.Add(bbl);

            // Force Scroll to the latest bubble
            bbl.Focus();

            // save the last added object to the dummy bubble
            bbl_old = bbl;
        }
Пример #2
0
        // User Message Bubble Creation
        public void addInMessage(string message)
        {
            if (message == "I am not smart enough to understand what the heck you just said, sorry.")
            {
                return;
            }

            // Create new chat bubble
            bubble bbl = new bubble(message, msgtype.In);

            bbl.Location = bubble1.Location;    // Set the new bubble location from the bubble sample.
            bbl.Left    += 50;                  // Indent the bubble to the right side.
            bbl.Size     = bubble1.Size;        // Set the new bubble size from the bubble sample.
            bbl.Top      = bbl_old.Bottom + 10; // Position the bubble below the previous one with some extra space.

            // Add the new bubble to the panel.
            panel2.Controls.Add(bbl);

            // Force Scroll to the latest bubble
            bbl.Focus();

            // save the last added object to the dummy bubble
            bbl_old = bbl;
        }