2020年11月19日 星期四

[ C# ] 邊框與文字對齊

 一、邊框 BorderStyle 

1. 3D立體框線:BorderStyle.Fixed3D

2. 單線條框線:BorderStyle.FixedSingle

3. 無框線:BorderStyle.None

例:label1.BorderStyle = BorderStyle.Fixed3D;


二、文字對齊 TextAlign

1.ContentAlignment 內容對準對齊類型如下:

(1)TopLeft 上左

(2)TopCenter 上中

(3)TopRight 上右

(4)MiddleLeft 中左

(5)MiddleCenter 中中

(6)MiddleRight 中右

(7)BottomLeft 下左

(8)BottomCenter 下中

(9)BottomRight 下右

例:button1.TextAlign = ContentAlignment.BottomRight;


三、FontStyle 字型樣式

1.字型類型

Bold 粗體

Italic 斜體

Regular 標準

Strikeout 刪除線

Underline 底線


2.語法如下:

例:label1.Font=new Font("新細明體",16,FontStyle.Italic);



沒有留言:

張貼留言

影片的問題請留在影片的留言區裡。
部落格不會另外通知給我,所以很難發現你有留言。