LToolbar::SetButtonEnabled

Summary

Enables or disables the specified button in the toolbar.

Syntax

#include "ltwrappr.h"

L_INT LToolbar::SetButtonEnabled (uButtonID, bEnable)

Parameters

L_UINT uButtonID

Identifier of the button to enable or disable.

L_BOOL bEnable

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

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LToolbar__SetButtonEnabledExample(L_UINT uButtonID, LToolbar* tlb) 
 
{ 
   L_INT nRet; 
 
   if ( tlb->IsValid () ) /* check the validity of the toolbar handle */ 
 
   { 
 
      L_BOOL bEnabled ; 
 
      /* Get the state of the toolbar button */ 
 
       bEnabled = tlb->IsButtonEnabled (uButtonID) ; 
 
       if ( bEnabled )  
 
      { 
 
         /* Disable the button */ 
 
         nRet = tlb->SetButtonEnabled (uButtonID, FALSE ) ; 
         if(nRet != SUCCESS) 
            return nRet; 
 
      } 
 
      else 
 
      { 
 
         /* Enable the button */ 
 
         nRet = tlb->SetButtonEnabled (uButtonID, TRUE ) ; 
         if(nRet != SUCCESS) 
            return nRet; 
 
      } 
 
   } 
 
   else 
 
   { 
 
      return FAILURE ; 
 
   } 
 
   return SUCCESS ; 
 
} 
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++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.