最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C#仿QQ聊天窗口

 更新時(shí)間:2021年07月11日 10:16:18   作者:Dust_SongYunfei  
這篇文章主要為大家詳細(xì)介紹了C#仿QQ聊天窗口,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了C#實(shí)現(xiàn)QQ聊天窗口的具體代碼,供大家參考,具體內(nèi)容如下

效果圖:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;// 用于暫停 的線程
namespace 聊天窗口
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        int x, y;// x為窗體left,y為窗體top
        private void Form1_Load(object sender, EventArgs e)
        {
            this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 2, Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 2);
            x = this.Left;
            y = this.Top;
            this.AcceptButton = button2; //按回車發(fā)送
            textBox1.ReadOnly = true; // 禁止輸入
            textBox1.ScrollBars = ScrollBars.Vertical; //顯示垂直滾動(dòng)條
            textBox1.Font = new Font("", 16);
            textBox2.Font = new Font("", 16); 
        }
        int t = 5, space = 10;// t為暫停時(shí)間,space為移動(dòng)距離

        //抖動(dòng)
        private void button1_Click(object sender, EventArgs e)
        {  // 循環(huán)抖動(dòng)
            for (int i = 0; i <5; i++)
            {  // 改變窗體位置
                this.Location = new Point(x - space, y);
                Thread.Sleep(t);
                this.Location = new Point(x - space, y - space);
                Thread.Sleep(t);
                this.Location = new Point(x, y - space);
                Thread.Sleep(t);
                this.Location = new Point(x + space, y - space);
                Thread.Sleep(t);
                this.Location = new Point(x + space, y);
                Thread.Sleep(t);
                this.Location = new Point(x + space, y + space);
                Thread.Sleep(t);
                this.Location = new Point(x, y + space);
                Thread.Sleep(t);
                this.Location = new Point(x - space, y + space);
                Thread.Sleep(t);
                this.Location = new Point(x - space, y);
                Thread.Sleep(t);
                this.Location = new Point(x, y);
            }
        }
        // 發(fā)送
        private void button2_Click(object sender, EventArgs e)
        { 
            // 記錄超出文本框高度 最新消息顯示
            textBox1.AppendText(DateTime.Now + "\r\n" + textBox2.Text + "\r\n");
            textBox2.Text = " ";// 文本框清空
        }

    }
}

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

洪雅县| 庆安县| 阿鲁科尔沁旗| 安达市| 梁山县| 利津县| 大港区| 图木舒克市| 贡觉县| 林芝县| 布尔津县| 阜平县| 德钦县| 林芝县| 兰考县| 冀州市| 乡城县| 右玉县| 尖扎县| 广丰县| 铜鼓县| 正镶白旗| 克拉玛依市| 罗甸县| 铜陵市| 星座| 金溪县| 丰城市| 威海市| 九寨沟县| 泰宁县| 望城县| 兖州市| 舟曲县| 光山县| 惠来县| 卓资县| 六盘水市| 囊谦县| 太湖县| 桦甸市|