Results 1 to 2 of 2

Thread: Some richtextbox questions

  1. #1

    Thread Starter
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527

    Some richtextbox questions

    Few questions re: rtb stuff

    (Similar to mIRC textbox)

    How can I allow users to make a selection, copy what they select, but not let the rtb get focus?

    I'm using rtb.appendtext to add stuff to the text box, then I have to use ScrollToCaret()

    I'd prefer not to do that, and I just want to have it scroll right to the end, without actually showing the cursor etc

    Basically, I'd like the functionality of the mirc text control thing

    Hope someone out there can help me

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            With rtfMircClone
                .SelectionStart = Len(.Text)
                .SelectedText = "I'm some server data :TKCHATACHAT001 613 127.0.0.1 6667" & vbCrLf
                .SelectedText = "i'm the next row of data" & Chr(10) '// same effect as vbcrlf
            End With
        End Sub
    
        Private Sub rtfMircClone_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rtfMircClone.MouseUp
            rtfMircClone.SelectionStart = Len(rtfMircClone.Text)
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            rtfMircClone.AppendText("extra text getting appended to end of data" & Chr(10))
        End Sub
    you need to set hide selection to FALSE so that the richtextbox scrolls when the text reaches the bottom of the visible area of it.
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

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