form1.frm
来自「文字效果VB源程序」· FRM 代码 · 共 46 行
FRM
46 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3360
ClientLeft = 60
ClientTop = 345
ClientWidth = 4950
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 3360
ScaleWidth = 4950
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "点击按钮"
Height = 420
Left = 1710
TabIndex = 0
Top = 2640
Width = 1515
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Const DST_TEXT = &H1
Private Const DSS_DISABLED = &H20
Private Declare Function DrawState Lib "user32" Alias "DrawStateA" _
(ByVal hDC As Long, ByVal hBrush As Long, ByVal _
lpDrawStateProc As Long, ByVal lParam As String, _
ByVal wParam As Long, ByVal n1 As Long, ByVal n2 As Long, _
ByVal n3 As Long, ByVal n4 As Long, ByVal un As Long) As Long
Private Sub Command1_Click()
Dim FontStr As String
FontStr = "华中理工大学Hust"
FontSize = 30
DrawState Me.hDC, 0, 0, FontStr, LenB(StrConv(FontStr, vbFromUnicode)), 10, 80, 0, 0, DST_TEXT Or DSS_DISABLED
Me.AutoRedraw = True
DrawState Me.hDC, 0, 0, FontStr, LenB(StrConv(FontStr, vbFromUnicode)), 10, 80, 0, 0, DST_TEXT Or DSS_DISABLED
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?