C# WinForm里:
如何让一个label倾斜放置  比如旋转了30度放置  至于label的其他属性功能不变
因为我要在这个label里写字  想让写的字也是倾斜的 所以要让label倾斜 
不要告诉我用 photoshop做个倾斜字的图片放里面  我不想这样谢谢您的指教  一旦有方法  立即给分  本人在线  谢谢!

解决方案 »

  1.   

    using System;
    using System.Drawing;
    using System.Windows.Forms;
    using System.Drawing.Drawing2D;namespace WindowsApplication14
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
     
            private void Form1_Paint(object sender, PaintEventArgs e)
            {
                Graphics g = e.Graphics;            g.DrawString("jinjazz 路过", this.Font, Brushes.Blue, 60, 0);            g.RotateTransform(30);
                g.DrawString( "jinjazz 路过", this.Font, Brushes.Blue, 60, 0);
                g.ResetTransform();
               
            }
        }
    }
      

  2.   

            private void button4_Click(object sender, EventArgs e)
            {
                Graphics g = this.label1.CreateGraphics();
                g.RotateTransform(30);
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
                g.DrawString(this.label1.Text, this.label1.Font, Brushes.Red, new Point(20,20));
            }建议你还是做成控件,上面的代码放在onpain里面,角度,颜色之类的做成属性,这样方便使用。