#include "ltwrappr.h"
L_INT LToolbar::SetButtonVisible (uButtonID, bVisible )
Sets the visibility state of the specified button in a toolbar.
Identifier of the button to set its visibility.
Flag that indicates whether to make the specified button visible or invisible. Possible values are:
Value | Meaning |
---|---|
TRUE | Make the specified button visible. |
FALSE | Make the specified button hidden. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To determine whether a button is visible or hidden, call LToolbar::IsButtonVisible.
Required DLLs and Libraries
L_INT LToolbar__SetButtonVisibleExample(L_UINT uButtonID, LToolbar* tlb)
{
L_INT nRet;
if ( tlb->IsValid () ) /* check the validity of the toolbar handle */
{
L_BOOL fVisible ;
/* Get the state of the toolbar button visibility */
fVisible = tlb->IsButtonVisible (uButtonID) ;
if ( fVisible )
{
/* Hid the button */
nRet = tlb->SetButtonVisible (uButtonID, FALSE ) ;
if(nRet != SUCCESS)
return nRet;
}
else
{
/* Show the button */
nRet = tlb->SetButtonVisible (uButtonID, TRUE ) ;
if(nRet != SUCCESS)
return nRet;
}
}
else
{
return FAILURE ;
}
return SUCCESS ;
}