Welcome! Log In Create A New Profile

Advanced

Programming PgUp and PgDn in Edit Control

Posted by Marco Rego 
Marco Rego
Programming PgUp and PgDn in Edit Control
February 12, 2009 06:35PM
Hi.
Need to show a RTF string in a Edit Control that needs to have no scroll bars. Basically I need to implement PgUp and PgDn functionalities to the text being showed.

Looking for the CRLF in the string I could determine where each line starts but with the Cursor property I could not figure out how to set a certain line to be the first to show in the Edit.

Any help on how could I do that ?




Edited 1 time(s). Last edit at 02/12/2009 06:36PM by Marco Rego.
Marco Rego
Re: Programming PgUp and PgDn in Edit Control
February 12, 2009 09:39PM
Just an idea, is there a way similar to ExecuteProcess that I could trigger the vertical scroll ?
Fabrice Harari
Re: Programming PgUp and PgDn in Edit Control
February 12, 2009 11:23PM
Hi Marco...

if I'm not mistaken, as long as the field is in edit mode (ie active), pageup and pagedw will work even if the scrollbar are not visible, when the cursor is in the field of course...

And if hte user is not allowed to modify, just add:
FieldName=FieldOriginalValue in the 'modification' code of the field

Best regards

Marco Rego
Re: Programming PgUp and PgDn in Edit Control
February 13, 2009 12:19AM
Fabrice, my bad, I forgot to mention that the Edit is Read Only and I don't want its I-Bean cursor to show.
My real intent is to show the text in a presentation like way (like PowerPoint).
Thanks.

______
Marco
Harry Wubbels
Re: Programming PgUp and PgDn in Edit Control
February 13, 2009 05:09PM
Hello,

Maybe you can do something with Sendkey
When you know that your first line of text is on line 10 en your control can contain 15 lines of text you can do something like:

loop(25)
SendKey("%{DOWN}",YourControlName)
end

Did not test anything...

Regards Harry
Marco Rego
Re: Programming PgUp and PgDn in Edit Control
February 13, 2009 09:19PM
SendKey("{PGUP}", myEditControl) worked just fine, thanks for this solution.
Now I have another problem, whenever I do this the vertical cursor (I-Bean) shows in the edit and I want it not to show.
Any clue ?
Alexandre Leclerc
Re: Programming PgUp and PgDn in Edit Control
February 13, 2009 10:53PM
Hi Marco,

Simply SetFocus() after your SendKey() on another control and you'll be in business.

Kind regards.
Marco Rego
Re: Programming PgUp and PgDn in Edit Control
February 14, 2009 02:39PM
Harry and Alexandre, thanks a bunch for the help. All is working as desired.
Have a blessed weekend.

______
Marco
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: