Changing the visibility of the scroll bar

Post Reply
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Changing the visibility of the scroll bar

Post by Natter »

Hi,

There is an object of type TXBrowse. I need to hide/show its vertical scroll while working. How can I do this ?
User avatar
MaxP
Posts: 90
Joined: Thu Jul 12, 2007 2:02 pm
Has thanked: 1 time
Contact:

Re: Changing the visibility of the scroll bar

Post by MaxP »

Hi Natter,

try this

Code: Select all | Expand

#include "Fivewin.ch"

FUNCTION MAIN()
        LOCAL   oWnd, oBtn1, oBtn2

        DEFINE WINDOW oWnd TITLE "TEST" COLOR "N/W" FROM 10, 10 TO 30, 70 VSCROLL

        @ 8, 10 BUTTON oBtn1 PROMPT "GO ON" SIZE 50, 20 ACTION ShowScrollBar( oWnd:hWnd, .T. ) OF oWnd
        
        @ 8, 20 BUTTON oBtn2 PROMPT "GO OFF" SIZE 50, 20 ACTION ShowScrollBar( oWnd:hWnd, .F. ) OF oWnd

        ACTIVATE WINDOW oWnd
RETURN NIL

#pragma BEGINDUMP

#include <windows.h>
#include <winioctl.h>
#include <stdio.h>
#include <shlobj.h>
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapifs.h"
#include "hbvm.h"
#include "hbstack.h"

HB_FUNC( SHOWSCROLLBAR )

{
        ShowScrollBar( (HWND)hb_parnl( 1 ), SB_VERT, hb_parl( 2 ) ) ;
}

#pragma ENDDUMP
Massimo
User avatar
Antonio Linares
Site Admin
Posts: 42548
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 78 times
Contact:

Re: Changing the visibility of the scroll bar

Post by Antonio Linares »

Thanks Massimo

Just a comment, for 64 bits we must use:

ShowScrollBar( (HWND)hb_parnll( 1 ), SB_VERT, hb_parl( 2 ) ) ;
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1241
Joined: Mon May 14, 2007 9:49 am

Re: Changing the visibility of the scroll bar

Post by Natter »

Thanks, Massimo !
Post Reply