L_TBSetButtonChecked

#include "LtTLB.h"

L_LTTLB_API L_INT L_TBSetButtonChecked (pToolbar, uButtonID)

Selects (checks) the given button in the toolbar.

Parameters

pTOOLBARHANDLE pToolbar

Pointer to a toolbar handle.

L_UINT uButtonID

Identifier of the button to select (check) .

Returns

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

Comments

Only one button may be selected (checked) at a time.

To determine whether a button is selected (checked), call L_TBGetButtonChecked.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will check the current check button in the toolbar and then if the checked button is not equal the required button, the required button will be checked

L_INT TBSetButtonCheckedExample( pTOOLBARHANDLE pLeadToolbar,L_UINT uButtonID ) 
{ 
   L_INT nRet; 
   /* check the validity of the toolbar handle */ 
   nRet = L_TBIsValid ( pLeadToolbar ); 
 
   if (SUCCESS == nRet ) 
   { 
      L_INT nCheckedID ; 
 
      /* Get the current checked button in the toolbar */ 
      nRet = L_TBGetButtonChecked ( pLeadToolbar, &nCheckedID ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      if ( nCheckedID != (L_INT ) uButtonID ) 
      { 
         nRet = L_TBSetButtonChecked ( pLeadToolbar, uButtonID ) ; /* Check the required button */ 
         if(nRet != SUCCESS) 
            return nRet; 
      } 
 
      return SUCCESS ; 
   } 
   else 
      return nRet ; 
} 

Help Version 21.0.2021.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Toolbar C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.