Hi,
how is possible to change the text of a button in a toolbar?
Thank you
METHOD SetText( nButton, cText ) INLINE TBSetText( ::hWnd, nButton, cText )
#pragma BEGINDUMP
#include <hbapi.h>
#include <Windows.h>
#include <CommCtrl.h>
HB_FUNC( TBSETTEXT )
{
HWND hToolBar = ( HWND ) hb_parnl( 1 );
TBBUTTONINFO tbi;
memset( ( char * ) &tbi, 0, sizeof( tbi ) );
tbi.dwMask = TBIF_TEXT | TBIF_BYINDEX;
tbi.cbSize = sizeof( TBBUTTONINFO );
tbi.pszText = hb_parc( 3 );
tbi.cchText = hb_parclen( 3 );
SendMessage( hToolBar, TB_SETBUTTONINFO, hb_parni( 2 ) - 1, ( LPARAM ) &tbi );
}
oToolbar:SetText( 1, "Hello" ) // set first button text
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 55 guests