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;
            }
        }
    }
    
  • 相关阅读:
    JVM内存划分
    JVM内存划分
    类装载器学习
    xml文件参数类型有问题
    七牛云的使用
    PyCharm下载及使用
    安装python--环境配置
    软件测试--测试用例
    python selenium ——— 动态id、class定位
    JDBC封装的工具类
  • 原文地址:https://www.cnblogs.com/wangshuai/p/1682817.html
Copyright © 2011-2022 走看看