Hi,
how is possible to change the text of a button in a toolbar?
Thank you
Hi,
how is possible to change the text of a button in a toolbar?
Thank you
Have you tried: oBtn:setText("New Text")?
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 textAntonio,
thank you, works fine.
I've modify the Method Commad of the TToolBar to have the nId of the buttom when pressed:
Eval( bAction, Self ) -> Eval( bAction, Self, nID )
Bye
Riccardo
Riccardo,
> Eval( bAction, Self ) -> Eval( bAction, Self, nID )
Ok, we have also modified it here, though we may finally create a new Class TTBButton and the TBButton object will be supplied instead of nID.