这么有深度的问题lz只肯出10分啊 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;namespace WindowsApplication42 { public partial class Form1 : Form { public Form1() { InitializeComponent(); Label L = new Label(); L.Parent = this; //L.Text = ; L.Paint += new PaintEventHandler(L_Paint); } void L_Paint(object sender, PaintEventArgs e) { Label L = (Label)sender; L.AutoSize = false; String DrawText = "个人让弗格森是个很深入343t4eteages"; L.Height = (int)e.Graphics.MeasureString(DrawText, L.Font, DrawText.Length, new StringFormat(StringFormatFlags.DirectionVertical)).Height; e.Graphics.DrawString(DrawText, L.Font, new SolidBrush(L.ForeColor), new PointF(0, 0), new StringFormat(StringFormatFlags.DirectionVertical)); } } }
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication42
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent(); Label L = new Label();
L.Parent = this;
//L.Text = ;
L.Paint += new PaintEventHandler(L_Paint);
} void L_Paint(object sender, PaintEventArgs e)
{
Label L = (Label)sender;
L.AutoSize = false;
String DrawText = "个人让弗格森是个很深入343t4eteages";
L.Height = (int)e.Graphics.MeasureString(DrawText, L.Font, DrawText.Length, new StringFormat(StringFormatFlags.DirectionVertical)).Height;
e.Graphics.DrawString(DrawText, L.Font, new SolidBrush(L.ForeColor), new PointF(0, 0), new StringFormat(StringFormatFlags.DirectionVertical));
}
}
}