#include "LtTLB.h"
L_LTTLB_API L_INT L_TBSetButtonChecked (pToolbar, uButtonID)
Selects (checks) the given button in the toolbar.
Pointer to a toolbar handle.
Identifier of the button to select (check) .
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes |
Only one button may be selected (checked) at a time.
To determine whether a button is selected (checked), call L_TBGetButtonChecked.
Required DLLs and Libraries
LTTLB
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
This example will check the current check button in the toolbar and then if the checked button is not equal the required button, the required button will be checked
L_INT TBSetButtonCheckedExample( pTOOLBARHANDLE pLeadToolbar,L_UINT uButtonID )
{
L_INT nRet;
/* check the validity of the toolbar handle */
nRet = L_TBIsValid ( pLeadToolbar );
if (SUCCESS == nRet )
{
L_INT nCheckedID ;
/* Get the current checked button in the toolbar */
nRet = L_TBGetButtonChecked ( pLeadToolbar, &nCheckedID ) ;
if(nRet != SUCCESS)
return nRet;
if ( nCheckedID != (L_INT ) uButtonID )
{
nRet = L_TBSetButtonChecked ( pLeadToolbar, uButtonID ) ; /* Check the required button */
if(nRet != SUCCESS)
return nRet;
}
return SUCCESS ;
}
else
return nRet ;
}