Exemple #1
0
        private void NewMessageButton_Click(object sender, EventArgs e)
        {
            Console.WriteLine(RecipientName);
            ConversationFlowPanel.Controls.Clear();
            NewMessageItem newMessage = new NewMessageItem(MessageTitleLabel)
            {
                SenderID   = this.RecipientID,
                SenderName = RecipientName,
                Width      = ConversationFlowPanel.Width
            };


            ConversationFlowPanel.Controls.Add(newMessage);
            ConversationFlowPanel.ScrollControlIntoView(newMessage);
        }
Exemple #2
0
        private void ReplyButtonClick(object sender, EventArgs e)
        {
            Button           replyButton  = (Button)sender;
            ConversationItem priorMessage = (ConversationItem)replyButton.Parent;


            NewMessageItem replyMessage = new NewMessageItem(_conversationID, MessageTitleLabel)
            {
                ReceiverName = priorMessage.SenderName,
                ReceiverID   = priorMessage.SenderID,
                SenderID     = this.RecipientID,
                SenderName   = this.RecipientName,
                Width        = ConversationFlowPanel.Width
            };


            int prevIndex = ConversationFlowPanel.Controls.IndexOf(priorMessage);

            ConversationFlowPanel.Controls.Add(replyMessage);
            ConversationFlowPanel.Controls.SetChildIndex(replyMessage, prevIndex + 1);
            ConversationFlowPanel.ScrollControlIntoView(replyMessage);
        }