The EnableScrollBar API allows to enable or disable scrollbars.
It can be enabled or disabled all of them or only some of them.
The documentation claims that the minimum OS must be Vista.
***************
* Begin code
***************
# DEFINE SB_BOTH 3
# DEFINE SB_HORZ 0
# DEFINE SB_VERT 1
# DEFINE ESB_DISABLE_BOTH 3
# DEFINE ESB_DISABLE_DOWN 2
# DEFINE ESB_DISABLE_LEFT 1
# DEFINE ESB_DISABLE_LTUP 1
# DEFINE ESB_DISABLE_RIGHT 2
# DEFINE ESB_DISABLE_RTDN 2
# DEFINE ESB_DISABLE_UP 1
# DEFINE ESB_ENABLE_BOTH 0
DECLARE INTEGER EnableScrollBar IN user32 INTEGER hwnd, INTEGER wSBflags, INTEGER wArrows
PUBLIC ofrm
ofrm = CREATEOBJECT("MyForm")
ofrm.show()
DEFINE CLASS myform as Form
scrollbars = 3
ADD OBJECT edt as editbox WITH left=100,top=100,width=400,height=400,value=REPLICATE("Disco, Duhamel"+CHR(13),40)
ADD OBJECT chk as checkbox WITH value=.T.,caption='Enabled'
PROCEDURE chk.interactivechange
IF This.Value
EnableScrollBar(ThisForm.HWnd,SB_BOTH,ESB_ENABLE_BOTH)
ELSE
EnableScrollBar(ThisForm.HWnd,SB_BOTH,ESB_DISABLE_BOTH )
ENDIF
ENDPROC
ENDDEFINE
***************
* End code
***************
Biblio
http://www.cs.uofs.edu/~beidler/Ada/win32/win32-winuser.html
https://msdn.microsoft.com/en-us/library/windows/desktop/bb787579%28v=vs.85%29.aspx
Niciun comentariu:
Trimiteți un comentariu