模拟 QQ 弹出窗体

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;

namespace HelloWorld
{
    public partial class Form2 : Form
    {
        int oldX, oldY;
        public Form2()
        {
            InitializeComponent();
        }

       //窗体加载时,设置窗体的显示的初始位置为屏幕的右下角。

        private void Form2_Load(object sender, EventArgs e)
        {
            oldX = Screen.PrimaryScreen.WorkingArea.Width-this.Width;
            oldY = Screen.PrimaryScreen.WorkingArea.Height;
            this.Location = new Point(oldX,oldY);

        }
 

        private void button1_Click(object sender, EventArgs e)
        {
            if (((Button)sender).Text.Equals("1"))
            {
                this.button1.BackColor = Color.Red;
            }
        }
        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

       //显示消息框

        private void 显示消息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            for (int y1 = 0; y1 < this.Height; y1++ )
            {
                this.Location = new Point(oldX, oldY-y1);
                System.Threading.Thread.Sleep(10);
                this.Refresh();
            }

        }

       
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值