L_TBSetButtonEnabled

Summary

Enables or disables the specified button in a toolbar.

Syntax

#include "LtTLB.h"

L_LTTLB_API L_INT L_TBSetButtonEnabled(pToolbar, uButtonID, fEnable)

Parameters

pTOOLBARHANDLE pToolbar

Pointer to a toolbar handle.

L_UINT uButtonID

Identifier of the button to enable or disable.

L_BOOL fEnable

Flag that indicates whether to enable or disable the specified button. Possible values are:

Value Meaning
TRUE Enable the specified button.
FALSE Disable the specified button.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes

Comments

To determine whether a button is enabled or disabled, call L_TBIsButtonEnabled.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT TBSetButtonEnabledExample( pTOOLBARHANDLE pLeadToolbar,L_UINT uButtonID ) 
{ 
   L_INT nRet; 
   nRet = L_TBIsValid ( pLeadToolbar ); 
 
   if (SUCCESS == nRet ) /* check the validity of the toolbar handle */ 
   { 
      L_BOOL fEnabled; 
 
      /* Get the state of the toolbar button */ 
      nRet = L_TBIsButtonEnabled ( pLeadToolbar, uButtonID, &fEnabled ); 
      if(nRet != SUCCESS) 
         return nRet; 
 
       if ( fEnabled ) 
       { 
         nRet = L_TBSetButtonEnabled ( pLeadToolbar, uButtonID, FALSE ); /* Disable the button */ 
         if(nRet != SUCCESS) 
            return nRet; 
       } 
      else 
      { 
         nRet = L_TBSetButtonEnabled ( pLeadToolbar, uButtonID, TRUE ); /* Enable the button */ 
         if(nRet != SUCCESS) 
            return nRet; 
       } 
 
      return SUCCESS ; 
   } 
   else 
      return nRet ; 
} 
Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Toolbar C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.