Welcome! Log In Create A New Profile

Advanced

Spin Control Slider to move memo text

Posted by Hans60 
Hans60
Spin Control Slider to move memo text
February 11, 2009 01:03PM
In order to move text up and down in a memo field I like to use a spin control or a slider. There are samles for images etc but not for a normal text field. How can I access the scroll bar of a memo field using a slider or a spin controll. Could any of you help me on this?
Thanks in advance
Piet van Zanten
Re: Spin Control Slider to move memo text
February 13, 2009 12:03AM
Hi Hans,

You could use:
ScrollDown: SendMessage(Handle(edt_Text),277,1,919272)
ScrollUpconfused smileyendMessage(Handle(Table),277,0,919272)

Regards,
Piet
Hans60
Re: Spin Control Slider to move memo text
February 14, 2009 11:29AM
Thank you Piet,
that worked! I checked the docs but so far could not figure out what the two parameters do ,277,1,919272
is that part of the Windows API (WIN32)?

Hans
Piet van Zanten
Re: Spin Control Slider to move memo text
February 14, 2009 12:31PM
Hi Hans,

I figured this out by trapping the scroll event for a control.
Then you can trace the parameters. I did this for a table control:
Event("HScroll","Table1",WM_HSCROLL)

PROCEDURE Hscroll(nMessage, WPARAM , LPARAM )
// Event trapping
Trace(nMessage,WPARAM,LPARAM)
Then use SendMessage with these parameters to call the Windows API.
I used this technique to make two tables horizontally scroll simultaneous. Instead of the trace the scrolling is redirected to the other table:
Sendmessage(Handle(Table2),WPARAM,LPARAM)
In your case I used WM_VSCROLL to trace the vertical scrolling.

Regards,
Piet



Hans60
Re: Spin Control Slider to move memo text
February 14, 2009 08:15PM
Thanks Piet,
I am a beginner and I will have a look in to this as soon as I have time. When you say "trapping the scroll event for a control." Then I assume I have to do that programatically or is that a feature under windev. Thanks for all the info anyway.

Hans
Piet van Zanten
Re: Spin Control Slider to move memo text
February 15, 2009 02:07AM
Hi Hans,

Yes, I mean by creating a test window with the necessary controls and use the code I posted to see what happens. You can use different WM_ constants fir different events.

Regards,
Piet
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: