怎么设置vb文本框的行间距或者是richtextbox的行间距?????
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎么设置vb文本框的行间距或者是richtextbox的行间距?????相关的知识,希望对你有一定的参考价值。
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongPrivate Const WM_USER = &H400
Private Const EM_GETPARAFORMAT = WM_USER + 61
Private Const EM_SETPARAFORMAT = WM_USER + 71
Private Const MAX_TAB_STOPS As Long = 32
Private Const PFM_LINESPACING As Long = 256
Private Type PARAFORMAT2
cbSize As Long
dwMask As Long
wNumbering As Integer
wEffects As Integer
dxStartIndent As Long
dxRightIndent As Long
dxOffset As Long
wAlignment As Integer
cTabCount As Integer
rgxTabs(MAX_TAB_STOPS - 1) As Long
dySpaceBefore As Long
dySpaceAfter As Long
dyLineSpacing As Long
sStyle As Integer
bLineSpacingRule As Byte
bOutlineLevel As Byte
wShadingWeight As Integer
wShadingStyle As Integer
wNumberingStart As Integer
wNumberingStyle As Integer
wNumberingTab As Integer
wBorderSpace As Integer
wBorderWidth As Integer
wBorders As Integer
End Type
Private Sub Command1_Click()
Dim pf2 As PARAFORMAT2
Dim retval As Long
RichTextBox1.SelStart = Len(RichTextBox1.Text)
pf2.cbSize = LenB(pf2)
pf2.bLineSpacingRule = 3
pf2.dyLineSpacing = CLng(500 * Rnd) + 500 '指定500到1000twips随机行距
pf2.dwMask = PFM_LINESPACING
retval = SendMessage(RichTextBox1.hwnd, EM_SETPARAFORMAT, ByVal 0&, pf2)
End Sub
Private Sub Form_Load()
RichTextBox1.Text = RichTextBox1.Text & vbCrLf & "RichTextBox1"
End Sub 参考技术A 另类解法换一种行高较大的字体,例如微软雅黑字体
以上是关于怎么设置vb文本框的行间距或者是richtextbox的行间距?????的主要内容,如果未能解决你的问题,请参考以下文章
NSMutableAttributedString怎么设置label的行间距