Ejemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ChatForm.ChatboxInfo cbi = new ChatForm.ChatboxInfo();
            cbi.NamePlaceholder  = "testing";
            cbi.PhonePlaceholder = "(111) 222-3333";

            var chat_panel = new ChatForm.Chatbox(cbi);

            chat_panel.Name = "chat_panel";
            chat_panel.Dock = DockStyle.Fill;
            this.Controls.Add(chat_panel);
        }
Ejemplo n.º 2
0
        public Chatbox(ChatboxInfo _chatbox_info)
        {
            InitializeComponent();

            chatbox_info = _chatbox_info;

            clientnameLabel.Text = chatbox_info.NamePlaceholder;
            statusLabel.Text     = chatbox_info.StatusPlaceholder;
            phoneLabel.Text      = chatbox_info.PhonePlaceholder;
            chatTextbox.Text     = chatbox_info.ChatPlaceholder;

            chatTextbox.Enter  += ChatEnter;
            chatTextbox.Leave  += ChatLeave;
            sendButton.Click   += SendMessage;
            attachButton.Click += BuildAttachment;
            removeButton.Click += CancelAttachment;

            chatTextbox.KeyDown += OnEnter;

            AddMessage(null);
        }