窗口抖动

是一个平台:Net.Framework;
万事万物皆对象
对象三大特征:
属性;方法(主动行为);事件(被动行为)
计算机语言:机器语言:二进制语言(0、1)
C/S:client 客户端,各种APP软件
B/S:Browser 浏览器端程序 各种网站网页
在这里插入图片描述

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;
using System.Threading;
namespace _01demo
{
    public partial class zhen : Form
    {
        public zhen()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            this.BackColor = Color.Blue;
            this.Width = 300;
            this.Height = 300;
            this.Left = 300;
            this.Top = 300;
            //Thread:线程
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Random a = new Random();//随机色
            for (int i=0;i<5;i++)
            {
                this.Left = 305;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50);
                this.Top = 305;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50);
                this.Left = 300;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50)    ;
                this.Left = 295;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50);
                this.Top = 300;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50);
                this.Top = 295;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50);
                this.Left = 300;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50);
                this.Left = 305;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50);
                this.Top = 300;
                this.BackColor = Color.FromArgb(a.Next(255), a.Next(255), a.Next(255));
                Thread.Sleep(50);
                this.Left = 300;
            }
        }
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值