Hi, i have a little problem with a scrollbar. I have a window which contains a readonly edit control. The program gives the user some messages due the editcontrol. When the editcontrol is full, the user can use the scrollbar to see more. But the scrollbar doesnt work. And it would be cool if the edit control could automaticly scroll down, when its full. Anybody knows what wrong? I have this call for creating the edit control:

invoke CreateWindowEx,WS_EX_CLIENTEDGE, ADDR editclass,ADDR edittext1,\
WS_CHILD or WS_VISIBLE or WS_BORDER or ES_READONLY\
or WS_VSCROLL or ES_AUTOVSCROLL or ES_MULTILINE,\
310,15,220,140,hWnd,EDITID1,hInstance,NULL
mov edithandle1,eax

Thanx
Posted on 2002-04-12 06:09:25 by belial
After you add text to the edit control:

invoke SendMessage,hEdit,EM_SETSEL,-1,-1

and the text should scroll.

KetilO
Posted on 2002-04-12 06:29:37 by KetilO
no, sorry, it doesnt scroll. I have a buffer, in which the text of the edit control is stored. After changes in this buffer, i call a:

invoke SendMessage,hWnd,WM_PAINT,NULL,NULL
invoke SendMessage,edithandle1,EM_SETSEL,-1,-1

Anyway, do have to include a handler for the WM_VSCROLL messages?
Posted on 2002-04-12 11:22:48 by belial
I tested your code but I do have a working scrollbar... :confused:

Thomas
Posted on 2002-04-12 12:00:26 by Thomas
try this:

invoke SendMessage,hEdit,EM_SETSEL,-1,-1
invoke SendMessage,hEdit,EM_SCROLLCARET,0,0


sorry my above suggestion wasnt tested. here is a tested method that works.

invoke SendMessage,hEdit,EM_GETLINECOUNT,0,0
invoke SendMessage,hEdit,EM_LINESCROLL,0,eax
Posted on 2002-04-12 13:32:49 by smurf