Option Explicit
Private Declare Function SelectClipPath Lib "gdi32" (ByVal hDC As Long, ByVal iMode As Long) As Long
Private Declare Function BeginPath Lib "gdi32" (ByVal hDC 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 Const txt = "ASEP" & vbCrLf & "HIBBAN"
Public Function MakeFormChar(frm As Form)
Dim hRgn As Long
With frm.Font
.Name = "Comic Sans MS"
.Bold = True
.Size = 100
End With
With frm
.Width = frm.TextWidth(txt)
.Height = frm.TextHeight(txt)
BeginPath .hDC
.CurrentX = 0
.CurrentY = 0
frm.Print txt
EndPath .hDC
hRgn = PathToRegion(.hDC)
SetWindowRgn .hwnd, hRgn, False
.Move (Screen.Width - .Width) / 2, (Screen.Height - .Height) / 2
End With
End Function
Saturday, April 3, 2010
VB6 Code - Fungsi Untuk Membentuk Form Dari Huruf
Labels:
SDI Form