L_TBSetButtonVisible

#include "LtTLB.h"

L_INT EXT_FUNCTION L_TBSetButtonVisible(pToolbar, uButtonID, fVisible )

pTOOLBARHANDLE pToolbar;

/* pointer to a toolbar handle */

L_UINT uButtonID;

/* button ID */

L_BOOL fVisible;

/* visibility flag */

Sets the specified button to be visible or hidden.

Parameter

Description

pToolbar

Pointer to a toolbar handle.

uButtonID

Identifier of the button to set.

fVisible

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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

Comments

To determine whether a button is visible or hidden, call L_TBIsButtonVisible.

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.

See Also

Functions:

L_TBIsButtonVisible.

Topics:

Getting and Setting Toolbar Button Information

Example

L_INT ToggleToolbarButton ( pTOOLBARHANDLE pLeadToolbar, L_UINT uButtonID )
{
   if (SUCCESS == L_TBIsValid ( pLeadToolbar ) ) /* check the validity of the toolbar handle */
   {
      L_BOOL fVisible ; 

      /* Get the state of the toolbar button visibility */
     L_TBIsButtonVisible ( pLeadToolbar, uButtonID, &fVisible ) ;

      if ( fVisible ) 
      {
         /* Hid the button */
         L_TBSetButtonVisible ( pLeadToolbar, uButtonID, FALSE ) ;   
      }
      else
      {
         /* Show the button */
         L_TBSetButtonVisible ( pLeadToolbar, uButtonID, TRUE ) ;   
      }

      return SUCCESS ;
   }
   else
   {
      return FAILURE ;
   }