zoukankan      html  css  js  c++  java
  • QQ聊天窗口效果

    rtbDetail:显示聊天信息
    rtbChat:用户输入信息
     
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    
    namespace WindowsFormsApplication4
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            [DllImport("user32.dll")]
            private static extern int SendMessage(IntPtr hWnd,int msg,int wParam,IntPtr IParam);
            private const int WM_VSCROLL = 0x115;
            private const int SB_BOTTOM = 7;
            private int lastSelectedIndex = -1;
    
            private void btnSend_Click(object sender, EventArgs e)
            {
                rtbDetail.Text += rtbChat.Text+Environment.NewLine;
                rtbChat.Text = "";
                SendMessage(rtbDetail.Handle,WM_VSCROLL,SB_BOTTOM,new IntPtr(0));
                rtbChat.Focus();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                rtbChat.Focus();
                this.AcceptButton = btnSend;
            }
        }
    }
    
  • 相关阅读:
    dedecms内容页调用缩略图 缩略图多种用法(借鉴)
    线性回归
    Jupyter Notebook 快捷键
    etcd入门
    Centos7 Docker安装
    TFIDF介绍
    Ceph 概念理解
    Nifi简介及核心概念整理
    经典排序算法总结
    Hbase协处理器
  • 原文地址:https://www.cnblogs.com/wangshuai/p/1682817.html
Copyright © 2011-2022 走看看