C# 設(shè)置制表位控制文本項的輸出位置
當(dāng)前位置:點晴教程→知識管理交流
→『 技術(shù)文檔交流 』
C# 設(shè)置制表位控制文本項的輸出位置,將文字輸出成表格的樣式: 設(shè)置制表位控制文本項的輸出位置 string MyText = " 姓名\t高等數(shù)學(xué)\t離散數(shù)學(xué)\t數(shù)據(jù)結(jié)構(gòu)\n"; MyText = MyText + "李開斌\t95\t81\t92\n"; MyText = MyText + "湯小敏\t78\t84\t75\n"; MyText = MyText + "湯柱蘭\t84\t76\t82\n"; MyText = MyText + "蔣蘭坤\t85\t92\t66\n"; MyText = MyText + "黃 麗\t83\t91\t75\n"; MyText = MyText + "張中姣\t75\t88\t82\n"; FontFamily MyFontFamily = new FontFamily("宋體"); Font MyFont = new Font(MyFontFamily, 10, FontStyle.Regular, GraphicsUnit.Point); Rectangle MyRect = new Rectangle(25, 70, 280, 110); SolidBrush MyBrush = new SolidBrush(Color.FromArgb(255, 0, 128, 255)); StringFormat MyFormat = new StringFormat(); float[] MyTabArray = { 60, 80, 80 }; MyFormat.SetTabStops(0, MyTabArray); e.Graphics.DrawString(MyText, MyFont, MyBrush, MyRect, MyFormat); 該文章在 2021/2/4 9:17:00 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |