国庆来临,画一面五星红旗,祝愿祖国繁荣昌盛 
'五星红旗(献给祖国56岁生日) 
Private Sub Form_Load()
Dim i As Integer
With Me
.Move Screen.Width * 0.1, Screen.Height * 0.1, Screen.Width * 0.8, Screen.Height * 0.8
.AutoRedraw = True
.BackColor = vbRed
.ForeColor = vbYellow
.Caption = "五星红旗"
.Icon = LoadPicture("")
For i = 0 To 4
.CurrentX = Array(0.01, 0.25, 0.35, 0.35, 0.25)(i) * Me.Width
.CurrentY = Array(0.05, 0, 0.13, 0.32, 0.45)(i) * Me.Height
.FontSize = Array(150, 50, 50, 50, 50)(i)
Print Chr(&HA1EF)
Next
End With
End Sub本文引用地址: http://blog.csdn.net/northwolves/services/trackbacks/486053.aspx 

解决方案 »

  1.   

    國慶節快樂
    Option Explicit
    Private Declare Function BeginPath Lib "gdi32" (ByVal hdc As Long) As Long
    Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
    Private Declare Function EndPath Lib "gdi32" (ByVal hdc As Long) As Long
    Private Declare Function PathToRegion Lib "gdi32" (ByVal hdc As Long) As Long
    Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
    Private Sub Form_Load()
        Dim hRgn As Long
        Dim longth As Integer
        Dim sname As String
        Dim sPath As String
        
        Me.WindowState = 2
        Me.FontName = "Arial"
        Me.FontSize = 50
        Me.BackColor = RGB(0, 255, 0)
        BeginPath Me.hdc
        'sname = user_name
        TextOut Me.hdc, 20, 50, "國慶節快樂!", Len(StrConv("國慶節快樂!", vbUnicode))
        EndPath Me.hdc
        hRgn = PathToRegion(Me.hdc)
        SetWindowRgn Me.hWnd, hRgn, TrueEnd Sub