Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Double Space in RTB

Does anyone know how to doublespace lines in a RTB  lso i just want to double space the lines i have selected.

example..

line1
line2
line3

becomes

line1

line2

line3
0
BI5HOP
Asked:
BI5HOP
1 Solution
 
EDDYKTCommented:
How about


Private Sub rtfText_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = 13) Then
    If (Len(rtfText.SelText) > 0) Then
        Debug.Print Replace(Replace(rtfText.SelText, vbCrLf & vbCrLf, vbCrLf), vbCrLf, vbCrLf & vbCrLf)
        KeyCode = 0
        rtfText.SelText = Replace(Replace(rtfText.SelText, vbCrLf & vbCrLf, vbCrLf), vbCrLf, vbCrLf & vbCrLf)
    End If
End If
End Sub
0
 
BI5HOPAuthor Commented:
I had to make a small change since i wanted it on rightclick i forgot to mention that but yea it worked great thanks :)

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now