C 中氣泡碰撞案例的實現

2021-10-06 15:38:05 字數 596 閱讀 8614

private void form1_load(object sender, eventargs e)

int x = 5;//int整形直接賦值x=5

int y = 4;//同上y=4

//x正數向右移動,負數向左移動

//y正數向下移動,負數向上移動

private void timer1_tick(object sender, eventargs e)

if (x < 0 && y > 0)

}if (this.left + this.width >= screen.primaryscreen.bounds.width)

//上面這個是判斷窗體左邊緣加上窗體的寬度是否大於桌邊(容器)的寬度

if (x > 0 && y < 0)

}if (this.left<= 0)

//上面這個是判斷窗體的左邊緣是否接觸到了容器壁

if (x < 0 && y > 0)

}if (this.top<= 0)

//上面這個是判斷窗體的上邊緣是否接觸到了容器壁

if (x > 0 && y < 0)

}

使用C 實現氣泡碰撞案例2 0版本

首先上次零基礎c 學習 一 中寫到了乙個timer控制氣泡碰撞的案例,其中過程較為複雜,所以這次我們把他進行整理優化.同樣也是實現了乙個timer 控制氣泡的碰撞,但這次較為簡單.其中還實現了多個窗體物件並存的現象.timer1.start 開啟計時器timer1 下面主要講的是,氣泡案例的簡單方法...

氣泡小角的css實現

doctype html html xmlns dir ltr head title css 箭頭demo title style type text css 基本樣式 tip 箭頭 before and after,一起組成了氣泡小角 tip before 小角的背景填充 tip after st...

C 輕鬆實現視窗氣泡彈動

this formborderstyle formborderstyle.none 設定窗體無邊框 this size newsize 200 200 設定窗體大小 this backcolor color.red 設定背景顏色 this location newpoint 0 0 設定初始內容 t...