LToolbar::SetButtonChecked

#include "ltwrappr.h"

L_INT LToolbar::SetButtonChecked (uButtonID )

Checks (selects or presses) the given button in the toolbar.

Parameters

L_UINT uButtonID

Identifier of the button to check (or press).

Returns

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

Comments

The toolbar can have only one checked (pressed) button at a time.

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 LToolbar__SetButtonCheckedExample(L_UINT uButtonID, LToolbar* tlb) 
 
{ 
   L_INT nRet; 
 
   if ( tlb->IsValid () ) /* check the validity of the toolbar handle */ 
 
   { 
 
      L_INT nCheckedID ; 
 
      /* Get the current checked button in the toolbar */ 
 
      nCheckedID = tlb->GetButtonChecked () ; 
 
 
      if ( nCheckedID != ( L_INT ) uButtonID ) 
 
      { 
 
         /* Check the required button */ 
 
         nRet = tlb->SetButtonChecked (uButtonID ) ; 
         if(nRet != SUCCESS) 
            return nRet; 
 
      } 
 
   } 
 
   else 
 
   { 
 
      return FAILURE ; 
 
   } 
 
   return SUCCESS ; 
} 

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++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.