[DllImport("gdi32.dll", EntryPoint="CreateFontIndirect")]
public static extern int CreateFontIndirect(ref LOGFONT lpLogFont);[StructLayout(LayoutKind.Sequential)]
public struct LOGFONT {
public int lfHeight;
public int lfWidth;
public int lfEscapement;
public int lfOrientation;
public int lfWeight;
public byte lfItalic;
public byte lfUnderline;
public byte lfStrikeOut;
public byte lfCharSet;
public byte lfOutPrecision;
public byte lfClipPrecision;
public byte lfQuality;
public byte lfPitchAndFamily;
public <green>LF_FACESIZE)</green> lfFaceName(1;
}

解决方案 »

  1.   

    http://msdn.microsoft.com/en-us/library/aa288468(VS.71).aspx
      

  2.   

    还没写,看到msdn上有例子。你瞅一眼。看是你要的不。
      

  3.   

    这个例子我看过了,但是如何传递给控件的Font呢,比如Label.Font
      

  4.   


    Label label = new Label();
    LOGFONT lf = new LOGFONT();
    lf.lfHeight = label.Font.Height;
    lf.lfFaceName = label.Font.Name;
    IntPtr handle = CreateFontIndirect(lf);这样行不行?
      

  5.   

    IntPtr handle = CreateFontIndirect(lf);这样的话,label的字体能改变么?
      

  6.   

    因为我这里想改变Label文字的拉长和拉宽问题
      

  7.   

    貌似这个创建的字体不可以用于.net吧。这个不是truetype的。
    不是很了解这个。
      

  8.   

    http://dev.firnow.com/course/4_webprogram/asp.net/netjs/200798/70670.html
      

  9.   

    发现即使TrueType的也是不行的,哎~~~~
    还有其他方法么?