how to get Handle of Scrollbar() of Control ?

how to get Handle of Scrollbar() of Control ?

Postby Jimmy » Sat Feb 25, 2023 7:18 am

hi,

i want to change Color of Scrollbar when appear.
for this i need Handle of Scrollbar

this i made under Xbase++
Image
---

i have override Fivewin Method for my CLASS TGrid()
Code: Select all  Expand view
  METHOD HScroll( nWParam, nLParam ) VIRTUAL // required for default behavior
   METHOD VScroll( nWParam, nLParam ) VIRTUAL // required for default behavior

in CLASS TWindow we have
Code: Select all  Expand view
  DATA oVScroll, oHScroll

which will be "filled"
Code: Select all  Expand view
  if lVScroll
      DEFINE SCROLLBAR ::oVScroll VERTICAL OF Self
   endif
   if lHScroll
      DEFINE SCROLLBAR ::oHScroll HORIZONTAL OF Self
   endif


now i try this
Code: Select all  Expand view
METHOD GetScrollbarObj(lVScroll)
LOCAL oObj
LOCAL hWnd := 0
DEFAULT lVScroll := .T.

   IF lVScroll
      IF __objHasData( self, "oVScroll" )
         oObj := ::oVScroll // VERTICAL
      ELSE
         MsgInfo("no oVScroll" )
      ENDIF
   ELSE
      IF __objHasData( self, "oHScroll" )
         oObj := ::oHScroll // HORIZONTAL
      ELSE
         MsgInfo("no oHScroll" )
      ENDIF
   ENDIF

   IF VALTYPE(oObj) = "O"
      IF __objHasData( oObj, "hWnd" )
         hWnd := oObj:hWnd
      ELSE
         MsgInfo("no oObj:hWnd" )
      ENDIF
   ELSE
      MsgInfo("no Object" )
   ENDIF

RETURN hWnd

but i get "no Object" even when i can "see" Scrollbar ( ACTION GetScrollbarObj() with Button )
do what i´m doing wrong :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 100 guests

cron