LToolbar::RemoveButton

#include "ltwrappr.h"

L_INT LToolbar::RemoveButton(uButtonId)

Removes a button from the toolbar.

Parameters

L_UINT uButtonId

Button identifier that indicates the button to be removed. Note that if this button is the only remaining button in its tool, the whole tool is removed too.

Returns

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

Comments

To add a button to a toolbar, call LToolbar::AddButton.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will remove all the buttons from a toolbar.

L_INT LToolbar__RemoveButtonExample( HWND hWnd, LToolbar* tlb) 
 
{ 
   UNREFERENCED_PARAMETER(hWnd); 
 
   L_INT          nRet; 
   LTOOLBARINFO   ToolbarInfo; 
   L_UINT         i, j; 
 
   /* get toolbar info */ 
 
   ToolbarInfo.uStructSize = sizeof( LTOOLBARINFO ); 
 
   nRet = tlb->GetToolbarInfo (&ToolbarInfo , sizeof(LTOOLBARINFO) ); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* iterate through tools */ 
 
   for( i = 0; i < ToolbarInfo.uToolsCount; i++ ) 
 
   { 
 
      /* remove all buttons of this tool */ 
 
      for( j = 0; j < ToolbarInfo.pTools[ i ].uButtonsCount; j++ ) 
 
      { 
 
         nRet = tlb->RemoveButton (ToolbarInfo.pTools[ i ].pButtons[ j ].uID); 
         if(nRet != SUCCESS) 
            return nRet; 
 
      } 
 
   } 
 
   /* free the info structure */ 
 
   nRet = tlb->FreeToolbarInfo (&ToolbarInfo); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   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.