标题:初学者c#窗体写不出文本,求指教
取消只看楼主
wuwei2333979
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-9-21
结帖率:0
已结贴  问题点数:20 回复次数:0 
初学者c#窗体写不出文本,求指教
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
        {
            SolidBrush blueBrush = new SolidBrush(Color.Blue);
            SolidBrush redBrush = new SolidBrush(Color.Red);
            SolidBrush greenBrush = new SolidBrush(Color.Green);
            Rectangle rect = new Rectangle(20, 20, 200, 100);
            String drawString = "Hello GDI+ World!";
            Font drawFont = new Font("Verdana", 14);
            float x = 100.0F;
            float y = 100.0F;
            StringFormat drawFormat = new StringFormat();
            drawFormat.FormatFlags = StringFormatFlags.DirectionVertical;
            e.Graphics.DrawString("Drawing text", new Font("Tahoma", 14), greenBrush, rect);
            e.Graphics.DrawString(drawString, new Font("Arial", 12), redBrush, 120, 140);
            e.Graphics.DrawString(drawString, drawFont, blueBrush, x, y, drawFormat);
            blueBrush.Dispose();
            redBrush.Dispose();
            greenBrush.Dispose();
            drawFont.Dispose();
        }
搜索更多相关主题的帖子: private 
2013-09-21 19:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-420872-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.197030 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved