public void AddChattingTimePanelInDistoryPanel(ChattingTimePanel time)
 {
     this.flowLayoutPanelofDisChatting.Controls.Add(time);
     this.flowLayoutPanelofDisChatting.Height = this.flowLayoutPanelofDisChatting.Height + time.Height;
     //Point newPoint = new Point(0, this.flowLayoutPanel1.Height - flowLayoutPanel1.AutoScrollPosition.Y);
     //flowLayoutPanel1.AutoScrollPosition = newPoint;
 }
 public void AddChattingTimePanelInDistoryPanel(ChattingTimePanel time)
 {
     this.flowLayoutPanelofDisChatting.Controls.Add(time);
     this.flowLayoutPanelofDisChatting.Height = this.flowLayoutPanelofDisChatting.Height + time.Height;
     //Point newPoint = new Point(0, this.flowLayoutPanel1.Height - flowLayoutPanel1.AutoScrollPosition.Y);
     //flowLayoutPanel1.AutoScrollPosition = newPoint;
 }
 public void AddChattingTimePanel(ChattingTimePanel time)
 {
     this.flowLayoutPanelOfChattingNow.Controls.Add(time);
     this.flowLayoutPanelOfChattingNow.Height = this.flowLayoutPanelOfChattingNow.Height + time.Height;
     Point newPoint = new Point(0, this.flowLayoutPanel1.Height - flowLayoutPanel1.AutoScrollPosition.Y);
     flowLayoutPanel1.AutoScrollPosition = newPoint;
 }
        public void AddChattingTimePanel(ChattingTimePanel time)
        {
            this.flowLayoutPanelOfChattingNow.Controls.Add(time);
            this.flowLayoutPanelOfChattingNow.Height = this.flowLayoutPanelOfChattingNow.Height + time.Height;
            Point newPoint = new Point(0, this.flowLayoutPanel1.Height - flowLayoutPanel1.AutoScrollPosition.Y);

            flowLayoutPanel1.AutoScrollPosition = newPoint;
        }
        private void createChatPanel(string chatContent,long userId,DateTime dt)
        {
            ChattingTimePanel time = new ChattingTimePanel();
            time.TimeString = dt.ToString("yyyy-MM-dd HH:mm");
            this.chattingPanel1.AddChattingTimePanel(time);

            ChatintSubItem chatsubitem = new ChatintSubItem();
            chatsubitem.Message = chatContent;
            chatsubitem.HeaderId = int.Parse(userId.ToString());
            if (userId == sendUser.Id)
            {
                chatsubitem.IsSayIngIsMe = true;
            }
            else
            {
                chatsubitem.IsSayIngIsMe = false;
            }
            this.chattingPanel1.AddChattingSubItem(chatsubitem);
        }
        private void chattingPanel1_SeemoreLabelClicked(object sender, EventArgs e)
        {
            //this.linkLabel2.Cursor = Cursors.WaitCursor;
            try
            {
                KjqbService.ChatInService[] chat;

                chat = ser.SearchChatHistory((int)sendUser.Id, (int)receiveUser.Id, serviceTime);
                for (int i = 0; i < chat.Length; i++)
                {
                    if (chat[i].ReceiveUserId == sendUser.Id)
                    {
                        ChatintSubItem subitem = new ChatintSubItem();
                        subitem.HeaderId = int.Parse(receiveUser.Id.ToString());
                        subitem.Message = chat[i].ChatContent;
                        subitem.IsSayIngIsMe = false;

                        ChattingTimePanel time = new ChattingTimePanel();
                        time.TimeString = chat[i].TimeStamp.ToString("yyyy-MM-dd HH:mm");

                        this.chattingPanel1.AddChattingSubItemInDistoryPanel(subitem);

                        this.chattingPanel1.AddChattingTimePanelInDistoryPanel(time);
                        //createChatPanelOfflowlayout2(chat[i].ChatContent, receiveUser.KuName, chat[i].TimeStamp);
                    }
                    else if (chat[i].ReceiveUserId == receiveUser.Id)
                    {
                        ChatintSubItem subitem = new ChatintSubItem();
                        subitem.HeaderId = int.Parse(sendUser.Id.ToString());
                        subitem.Message = chat[i].ChatContent;
                        subitem.IsSayIngIsMe = true;

                        ChattingTimePanel time = new ChattingTimePanel();
                        time.TimeString = chat[i].TimeStamp.ToString("yyyy-MM-dd HH:mm");

                        this.chattingPanel1.AddChattingSubItemInDistoryPanel(subitem);

                        this.chattingPanel1.AddChattingTimePanelInDistoryPanel(time);

                        //createChatPanelOfflowlayout2(chat[i].ChatContent, sendUser.KuName, chat[i].TimeStamp);
                    }
                }

                serviceTime = chat[chat.Length - 1].TimeStamp;

                if (chat.Length > 0)
                {
                    //Point newPoint = new Point(0, 0);
                    //flowLayoutPanel1.AutoScrollPosition = newPoint;
                }
                else
                {
                this.chattingPanel1.SetSeeMoreLabelText("没有了…");
                }
            }
            catch { }

            //this.linkLabel2.Cursor = Cursors.Hand;
        }