예제 #1
0
        //双击一项,弹出聊天对话框
        private void sbFriends_ItemDoubleClick(SbItemEventArgs e)
        {
            //消息timer停止运行
            if (tmrChatRequest.Enabled == true)
            {
                tmrChatRequest.Stop();
                e.Item.ImageIndex = this.friendFaceId;
            }
            //显示聊天窗体
            ChatForm chatForm = new ChatForm();

            chatForm.friendId = Convert.ToInt32(e.Item.Tag); //号码
            chatForm.nickName = e.Item.Text;                 //昵称
            chatForm.faceId   = e.Item.ImageIndex;           //头像
            chatForm.Show();
        }
예제 #2
0
        // 双击一项,弹出聊天窗体        
        private void sbFriends_ItemDoubleClick(SbItemEventArgs e)
        {
            // 消息timer停止运行
            if (tmrChatRequest.Enabled == true)
            {
                tmrChatRequest.Stop();                
                e.Item.ImageIndex = this.friendFaceId;
            }

            // 显示聊天窗体
            ChatForm chatForm = new ChatForm();
            chatForm.friendId = Convert.ToInt32(e.Item.Tag); // 号码
            chatForm.nickName = e.Item.Text;  // 昵称
            chatForm.faceId = e.Item.ImageIndex;  // 头像
            chatForm.Show();
        }
예제 #3
0
        // 双击一项,弹出聊天窗体
        private void sbFriends_ItemDoubleClick(SbItemEventArgs e)
        {
            GetFriendsResponseModel friendModel = (GetFriendsResponseModel)e.Item.Tag;
            ChatForm chatForm = null;

            lock (this) {
                if (dicChats.ContainsKey(friendModel.friendid))
                {
                    chatForm = dicChats[friendModel.friendid];
                    chatForm.Show();
                }
                else
                {
                    // 显示聊天窗体
                    chatForm = new ChatForm(friendModel);
                    dicChats.Add(friendModel.friendid, chatForm);
                    chatForm.Show();
                }
                ((MyItem)e.Item).isShandong = false;
            }
        }