Rich text box & scroll bar 
Author Message
 Rich text box & scroll bar

I'm creating a simple control with a rich text box that is filled with a
license agreement.  There are 2 buttons, one for accepting the agreement and
one for not accepting.  I don't want to enable the 'accept' button until the
user has scrolled to the bottom of the rich text box.  Is there any easy way
to check this?  I added a vertical scroll bar on the rich text box, but
there doesn't seem to be any events for the scroll bar itself.

Any help is greatly appreciated, even if it is just pointing me in the right
direction.

Thanks in advance!

Dave Snyder



Wed, 27 Nov 2002 03:00:00 GMT  
 Rich text box & scroll bar
You could tell your users to read the license agreement and click on the
last line to when finished. Your last line could read something like:

     "I have read the above license"

(keep it short). You can check if the user has clicked on this line using
something like this in the Click event:

     Dim LastLine As String
     LastLine = "I have read the above license"
     With RichTextBox1
         If .SelStart >= Len(.Text) - Len(LastLine) Then
            '  Highlight The Line To Give Feedback To The User
            .SelStart = Len(.Text) - Len(LastLine)
            .SelLength = Len(LastLine)
            '  Enable The "Accept" Button
            CommandButton1.Enabled = True
         End If
     End With

Rick


Quote:
> I'm creating a simple control with a rich text box that is filled with a
> license agreement.  There are 2 buttons, one for accepting the agreement
and
> one for not accepting.  I don't want to enable the 'accept' button until
the
> user has scrolled to the bottom of the rich text box.  Is there any easy
way
> to check this?  I added a vertical scroll bar on the rich text box, but
> there doesn't seem to be any events for the scroll bar itself.

> Any help is greatly appreciated, even if it is just pointing me in the
right
> direction.

> Thanks in advance!

> Dave Snyder




Wed, 27 Nov 2002 03:00:00 GMT  
 Rich text box & scroll bar
You could tell your users to read the license agreement and click on the
last line to when finished. Your last line could read something like:

     "I have read the above license"

(keep it short). You can check if the user has clicked on this line using
something like this in the Click event:

     Dim LastLine As String
     LastLine = "I have read the above license"
     With RichTextBox1
         If .SelStart >= Len(.Text) - Len(LastLine) Then
            '  Highlight The Line To Give Feedback To The User
            .SelStart = Len(.Text) - Len(LastLine)
            .SelLength = Len(LastLine)
            '  Enable The "Accept" Button
            CommandButton1.Enabled = True
         End If
     End With

Rick


Quote:
> I'm creating a simple control with a rich text box that is filled with a
> license agreement.  There are 2 buttons, one for accepting the agreement
and
> one for not accepting.  I don't want to enable the 'accept' button until
the
> user has scrolled to the bottom of the rich text box.  Is there any easy
way
> to check this?  I added a vertical scroll bar on the rich text box, but
> there doesn't seem to be any events for the scroll bar itself.

> Any help is greatly appreciated, even if it is just pointing me in the
right
> direction.

> Thanks in advance!

> Dave Snyder




Wed, 27 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Rich Text Box & scroll bar

2. Rich text box & scroll bar

3. rich text box, remembering view / position of scroll bars

4. Run-time control of rich text box scroll bar visibility

5. Rich Text Box Control Scroll Bars

6. Rich Text Box Horiziontal Scroll Bar Problem

7. Scroll Bars in a Rich Text Box

8. Rich Text Box Scroll Bars

9. Rich Text Box vs. Text Box Scrolling

10. Text Box Scroll Bars & Find Dialogs

11. Truncating rich text box text & keeping formatting

12. Scrolling in (rich)text box?

 

 
Powered by phpBB® Forum Software