Memo Or Rich Edit

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheRealLokiSenior DeveloperCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jose ParrotGraphics ExpertCommented:
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
chudmarekAuthor Commented:
cheers, worked a treat!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.