C#窗體的常用設置
阿新 • • 發佈:2017-09-25
圖片 color 顏色 紅色 bsp blog cursor 常用 cursors
因為第三章題型都差不多,所以我就對常用的一些東西做了如下總結。
1.設置窗體的小圖標
Icon
在Icon屬性後面直接添加要改變的ico圖片。
2.設置窗體透明度
opacity
取值範圍:0~100(透明~不透明)
3.當窗體顏色有與設定值相同時的顏色時,該部分變為透明。
Transparencykey
eg:
BackColor = Color.Red;
TransparencyKey = Color.Red;
紅色的變為了透明
4.設置窗體中鼠標指針形狀
Cursor
eg:
this.Cursor = Cursors.Default;(默認)
this.Cursor = Cursors.WaitCursor;(等待)
this.Cursor = Cursors.Cross;(十字)
5.添加背景圖片
BackgroundImage
this.BackgroundImage = Image.FromFile(@"A:\45.jpg");
C#窗體的常用設置