Results 1 to 5 of 5

Thread: what might be an easy quesiton

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    is there a way you can insert a line in a richtextbox? I have a command button that allows the user to insert a horizontal line in the richtextbox, but I don't know how to do it... another one... how do you put up a picture file in a richtextbox

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Are you talking about a empty line? Simply do the following:
    Code:
    Public Sub Command1_Click()
         RichTextBox1.Text = RichTextBox1.Text & VbCrLf
    End Sub
    The VbCrLf places the empty line.

    Gl,
    D!m
    Dim

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Ca
    Posts
    106
    no no no... a horizontal line

    ---------------------------------------------------------
    like the one above... but solid and in one piece so that the user can move it or delete it with one push of a keyboard key

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    RichTextBox1.Text = RichTextBox1.Text & vbCrLf _
    & "__________________________________" & vbCrLf
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  5. #5
    Guest
    It might be easier to place it into a Sub.
    Code:
    Sub AddLine(rtfBox As RichTextBox, chChar As String, iLength As Integer)
        rtfBox.SelText = vbCrLf & String(iLength, chChar) & vbCrLf
    End Sub
    
    Private Sub Command1_Click()
        RichTextBox1.SetFocus
        'AddLine (RichTextBox), (Character to Use), (Length)
        AddLine RichTextBox1, "_", 20
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width