如题,RichTextBox中每行的间距设大些。
以前真没注意过,不知怎么解决,哪位帮帮忙?

解决方案 »

  1.   

    RichTextBox不支持,你可以用空格来加宽度
      

  2.   

    Option ExplicitPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As LongConst WM_USER = &H400
    Const PFM_LINESPACING = &H100
    Const MAX_TAB_STOPS = 32
    Const EM_SETPARAFORMAT = WM_USER + 71Private Type PARAFORMAT2
        cbSize As Integer
        wPad1 As Integer
        dwMask As Long
        wNumbering As Integer
        wReserved As Integer
        dxStartIndent As Long
        dxRightIndent As Long
        dxOffset As Long
        wAlignment As Integer
        cTabCount As Integer
        lTabStops(0 To MAX_TAB_STOPS - 1) As Long
        dySpaceBefore As Long          ' /* Vertical spacing before para         */
        dySpaceAfter As Long           ' /* Vertical spacing after para          */
        dyLineSpacing As Long          ' /* Line spacing depending on Rule       */
        sStyle As Integer                  ' /* Style handle
        bLineSpacingRule As Byte       ' /* Rule for line spacing (see tom.doc)  */
        bCRC As Byte                   ' /* Reserved for CRC for rapid searching *
        wShadingWeight As Integer          ' /* Shading in hundredths of a per cent
        wShadingStyle As Integer           ' /* Nibble 0: style, 1: cfpat, 2: cbpat
        wNumberingStart As Integer         ' /* Starting value for numbering
        wNumberingStyle As Integer        ' /* Alignment, roman/arabic, (), ), .,
        wNumberingTab As Integer           ' /* Space bet 1st indent and 1st-line
        wBorderSpace As Integer            ' /* Space between border and text
        wBorderWidth As Integer           ' /* Border pen width (twips)
        wBorders As Integer                ' /* Byte 0: bits specify which borders
    End TypePrivate Sub Command1_Click()
        Dim x As PARAFORMAT2
        
        RichTextBox1.SelStart = 0
        RichTextBox1.SelLength = Len(RichTextBox1.Text)
      
        x.cbSize = Len(x)
        x.dwMask = PFM_LINESPACING
        x.bLineSpacingRule = 5
        x.dyLineSpacing = 60
        Call SendMessage(RichTextBox1.hwnd, EM_SETPARAFORMAT, 0, x)
    End SubPrivate Sub Form_Load()
        RichTextBox1.Text = RichTextBox1.Text + vbCrLf
        RichTextBox1.Text = RichTextBox1.Text + "AAAAAAAAAAAAAAAA"
        RichTextBox1.Text = RichTextBox1.Text + vbCrLf
        RichTextBox1.Text = RichTextBox1.Text + "BBBBBBBBBBBBBBBBBb"
        RichTextBox1.Text = RichTextBox1.Text + vbCrLf
        RichTextBox1.Text = RichTextBox1.Text + "CCCCCCCCCCCCCCCCCCcc"
    End Sub
      

  3.   

    我也没找到一般的方法,最终还是要用API,没办法。
    谢谢各位
      

  4.   

    路过,请问老大:to TechnoFantasy(冰儿马甲www.applevb.com) ,哪里可以找到更多的关于RichTextBox的知识呢?比如插入图片、GIF动画、字符格式设置等等学习ing,万分感谢!
      

  5.   

    to happywqw(键盘跳蚤) 这些你得的问题都可以在微软的support网站 http://support.microsoft.com 找到