在winform界面上直接输出文字内容,并控制文字的大小样式,请问怎么做?

解决方案 »

  1.   

    在个lable空间 或者textbox也行啊   改变控件的属性就行啦  是这个意思吗
      

  2.   

    方法一:用textbox,设置无边框,背景色和窗体一致
    方法二:在窗体中使用键盘捕获事件
      

  3.   

    用richTextBox控件实现,具体用法可以在百度搜一下,很多关于richTextBox的用法
      

  4.   

    label l=new lable()
    l.text="";
    l.位置 我忘记怎么写了 貌似是point(1 2)
     然后在把l放from里就好了
      

  5.   

    用lable、richtextbox都是解决问题办法,我想找不使用控件,直接使用Graphics、Font、Brushl之类的图形设备对象控制文字输出的办法。时间紧,没搞过,来不及慢慢研究,请赐教啊~
      

  6.   

    找到办法,已经解决,吐下:
    SolidBrush aBrush = new SolidBrush(Color.Blue);
    Font aFont = new Font("Arial", 12, FontStyle.Bold, GraphicsUnit.Millimeter);
    int xPos = 0;
    int yPos = 0; Graphics graphic = this.CreateGraphics();
    graphic.DrawString ("This is a font test!", aFont, aBrush, xPos, yPos);
      

  7.   

    如果不想使用控件,直接在窗体上输出文字的话,可以考虑使用GDI+绘图法。
    写Form的Paint事件,如:
    this.Paint += new System.Windows.Forms.PaintEventHandler(Form1_Paint);
    void MainForm_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
    {
        Graphics g = e.Graphics;
        Font f = new Font("宋体", 10);
        g.DrawString("你好!", f, Brushes.Black, 20, 20);} 
    希望可以帮到你
      

  8.   

    上面的写错了,看这个:
    如果不想使用控件,直接在窗体上输出文字的话,可以考虑使用GDI+绘图法。
    写Form的Paint事件,如:C# code
    this.Paint += new System.Windows.Forms.PaintEventHandler(Form1_Paint);void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
    {
        Graphics g = e.Graphics;
        Font f = new Font("宋体", 10);
        g.DrawString("你好!", f, Brushes.Black, 20, 20);} 希望可以帮到你 
      

  9.   

    O O没有像VB一样简单的Print方法吗?我也想在Windows窗体上直接输出内容