LToolbar::SetButtonVisible

#include "ltwrappr.h"

L_INT LToolbar::SetButtonVisible (uButtonID, bVisible )

L_UINT uButtonID;

/* button ID */

L_BOOL bVisible;

/* visibility flag */

Sets the visibility state of the specified button in a toolbar.

Parameter

Description

uButtonID

Identifier of the button to set its visibility.

bVisible

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 LToolbar::IsButtonVisible.

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:

LToolbar::IsButtonVisible, Class Members

Topics:

Getting and Setting Toolbar Button Information

Example

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 ;
}