Memo Or Rich Edit

Posted on 2008-11-04
Last Modified: 2013-11-23
Hi All,

I am trying to add a click thru licence agreement on a certain page of my software. (I am using c++ builder 6)

I am currently using a RichEdit (but am open to using a memo)
I have my licence information in the richedit box, an "I agree" checkbox and a continue button.
The "I agree Button" is disbaled and my "Continue" button is also disabled.
I would like:

The "I agree" button to be enabled only when the user uses the vertical scroll bar, and that scroll bar hits the bottom (therefore assuming the whole thing has been read)

How do I get the richEdit to detect that its at the end of the document/or the bottom of the scroll bar.

Thanks in advance.
Question by:chudmarek
    LVL 17

    Accepted Solution

    Here is 1 way to do it
    place a TTimer on the form, and set it's interval to 100 (1/10th of a second)
    procedure TForm1.Timer1Timer(Sender: TObject);
      LinesInWindow = 11; // set this manually for now...
      i: integer;
      i := RichEdit1.Perform(EM_GETFIRSTVISIBLELINE, 0, 0);
      if (RichEdit1.Lines.Count - (LinesInWindow + 1)) < i then
        Button1.Enabled := True;
        Timer1.Enabled := False; // dont need this any more

    Open in new window

    LVL 18

    Expert Comment

    The Windows function
             int GetScrollPos( HWND hWnd, int nBar );
    returns the position of the scrollbar.
    Right now (I'm in the office) I don't have access to my PC which has Builder 6. If until night you don't have an answer, I'll try to check it. Anyway, you may want take a look at

    Author Closing Comment

    cheers, worked a treat!

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
    How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from ( Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now