Hy guys. I created both horizontal and vertical scrollbars for a RichEdit controls but they don't show. Anyone knows why?
There must be enought text in the richedit for that.
But without the code ,it isn't possible to affirm it is that.
There's enough text. the bars just dont show.
invoke CreateWindowEx,0,addr WC_SCROLLBAR,0,WS_VISIBLE+WS_CHILD+SBS_VERT+SBS_RIGHTALIGN,\
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,\
[edi.MdiStruct.hEdit],0,hInstance,0
mov [edi.MdiStruct.hVScroll],eax
invoke SendMessage,eax,SBM_SETRANGE,0,1000
invoke CreateWindowEx,0,addr WC_SCROLLBAR,0,WS_VISIBLE+WS_CHILD+SBS_HORZ+SBS_BOTTOMALIGN,\
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,\
[edi.MdiStruct.hEdit],0,hInstance,0
mov [edi.MdiStruct.hHScroll],eax
invoke SendMessage,eax,SBM_SETRANGE,0,1000
invoke EnableScrollBar,[edi.MdiStruct.hEdit],SB_BOTH,ESB_ENABLE_BOTH
oh i see now. they need size. i thought there was a way to automate the scrollbars. problem solved
This complicates the hell outta my job. if i use SBS_HORZ and SBS_VERT don't the scroll bars just appear sized and aligned as witth SBS_BOTTOMALGIN and SBS_LEFTALIGN?
Try this
Quote
INVOKE CreateWindowEx, NULL, addr crichedit, NULL,\
WS_CHILD or WS_BORDER or ES_MULTILINE or \
ES_NOHIDESEL or ES_SAVESEL or ES_SELECTIONBAR or\
WS_HSCROLL or ES_AUTOHSCROLL or\
WS_VSCROLL or ES_AUTOVSCROLL or WS_CLIPSIBLINGS or WS_CLIPCHILDREN,\
0, 0,largeur, hauteur, Htab,NULL, Hinst, NULL
Hi xandaz,
why don't you just use ES_AUTOHSCROLL | ES_AUTOVSCROLL in the style flags of the RichEdit ?
Setting up your own scroll bars needs management about line height/width and window height/width.
https://docs.microsoft.com/en-us/windows/win32/controls/scroll-text-in-scroll-bars
But I'm not sure if you receive the WM_HSCROLL/WM_VSCROLL messages if the mouse is ovr the rich edit control.
Kind regards
Greenhorn
Quote from: TouEnMasm on November 06, 2020, 04:47:04 AM
Try this
Quote
INVOKE CreateWindowEx, NULL, addr crichedit, NULL,\
WS_CHILD or WS_BORDER or ES_MULTILINE or \
ES_NOHIDESEL or ES_SAVESEL or ES_SELECTIONBAR or\
WS_HSCROLL or ES_AUTOHSCROLL or\
WS_VSCROLL or ES_AUTOVSCROLL or WS_CLIPSIBLINGS or WS_CLIPCHILDREN,\
0, 0,largeur, hauteur, Htab,NULL, Hinst, NULL
Thanks ToutEnMasm :thumbsup:
Thanks a lot. I knew there was a way. thanks tout :thumbsup: