更改场景字体

来源:互联网 发布:迷宫问题c语言递归 编辑:程序博客网 时间:2024/05/20 21:43
Private Type LOGFONT
        lfHeight As Long
        lfWidth As Long
        lfEscapement As Long
        lfOrientation As Long
        lfWeight As Long
        lfItalic As Byte
        lfUnderline As Byte
        lfStrikeOut As Byte
        lfCharSet As Byte
        lfOutPrecision As Byte
        lfClipPrecision As Byte
        lfQuality As Byte
        lfPitchAndFamily As Byte
        lfFaceName As String * 32
End Type
Private Declare Function CreateFontIndirect Lib "gdi32" Alias "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Dim ln As LOGFONT
Private Sub Command1_Click()
    ln.lfCharSet = 1
    ln.lfHeight = 100
    ln.lfFaceName = "华文新魏" & Chr$(0)
   
     SelectObject Me.hdc, CreateFontIndirect(ln)
   
    Print "中国"; "asd"
 
End Sub 
原创粉丝点击