Change text button Toolbar
Posted: Thu Sep 07, 2006 3:14 pm
Hi,
how is possible to change the text of a button in a toolbar?
Thank you
how is possible to change the text of a button in a toolbar?
Thank you
www.FiveTechSoft.com
https://fivetechsoft.com/forums/
Code: Select all
METHOD SetText( nButton, cText ) INLINE TBSetText( ::hWnd, nButton, cText )
Code: Select all
#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 );
}
Code: Select all
oToolbar:SetText( 1, "Hello" ) // set first button text