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
Di bawah ini merupakan fungsi VB6 untuk membentuk form dari sebuah huruf, kata, atau kalimat. Untuk keperluan ini Anda dapat memodifikasi besar serta jenis hurufnya. Untuk keperluan-keperluan yang seperti ini, kita tidak bisa memprogramnya secara langsung akan tetapi harus melewati fungsi-fungsi API. Bagaimana implementasinya dalam Visual Basic 6.0? bisa Anda simak implementasinya di bawah ini:
Labels:
SDI Form