CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Location
    North of France
    Posts
    25

    RichTextBox API or Method

    Hi,

    I would to know (or select) which part of text is see by a user of my application if there is a large quatity of text in my RichTextBox.

    Thanks in advance,
    Laurent.



  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: RichTextBox API or Method

    here is a simple sample that will select a certain art of a richtextbox. It will select text starting at location 10 for 100 characters

    private Sub Command1_Click()
    Dim X
    RichTextBox1.SetFocus
    RichTextBox1.SelStart = len(RichTextBox1.Text)
    for X = 1 to 50
    SendKeys "Add a new line " & X & vbCr
    next X
    DoEvents
    RichTextBox1.Refresh
    RichTextBox1.SelStart = 100
    RichTextBox1.SelLength = 100
    print len(RichTextBox1.Text)
    End Sub




    John G

  3. #3
    Join Date
    Jul 2001
    Location
    North of France
    Posts
    25

    Re: RichTextBox API or Method

    Hi,

    You are right this code select a part of the text but I would to select the part that is see by the user of my application.

    The goal of this question is to add color to a source in C language in my RichTextBox. But it take very long time if I work on the entire C source file. I would like to optimize and work only on the part of the code that is see by the user.

    Thank anyway,
    Laurent.



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

Featured