新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
一個簡單的C#窗口抖動效果實(shí)例
做一個簡單的C#窗口抖動,仿QQ窗口抖動效果!

創(chuàng)新互聯(lián)是一家專業(yè)從事成都網(wǎng)站制作、做網(wǎng)站的網(wǎng)絡(luò)公司。作為專業(yè)網(wǎng)絡(luò)公司,創(chuàng)新互聯(lián)依托的技術(shù)實(shí)力、以及多年的網(wǎng)站運(yùn)營經(jīng)驗(yàn),為您提供專業(yè)的成都網(wǎng)站建設(shè)、全網(wǎng)營銷推廣及網(wǎng)站設(shè)計開發(fā)服務(wù)!
首先,在窗口中添加一個按鈕:
C#窗口抖動圖
在按鈕中輸入一下代碼:
即:
- int recordx = this.Left;
- int recordy = this.Top;
- Random random = new Random();
- for (int i = 0; i < 150; i++)
- {
- int x = random.Next(rand);
- int y = random.Next(rand);
- if (x % 2 == 0)
- {
- this.Left = this.Left + x;
- }
- else
- {
- this.Left = this.Left - x;
- }
- if (y % 2 == 0)
- {
- this.Top = this.Top + y;
- }
- else
- {
- this.Top = this.Top - y;
- }
- this.Left = recordx;
- this.Top = recordy;
- }
這樣,一個簡單的C#窗口抖動效果就實(shí)現(xiàn)了!
當(dāng)前文章:一個簡單的C#窗口抖動效果實(shí)例
路徑分享:http://fisionsoft.com.cn/article/dpccsdp.html


咨詢
建站咨詢
