Type | Description | |||
ShowCheckedAsSelectedEnum | A ShowCheckedAsSelectedEnum expression that specifies whether the checked item shows as selected. |
The following screen shot shows the control when the ShowCheckedAsSelected property is exDisplayItemCheckDefault( by default ):
The following screen shot shows the control when the ShowCheckedAsSelected property is exDisplayItemCheckHighlight:
How can I add check-buttons to items, without showing the check-box (method 2)?
VBA (MS Access, Excell...)
With ToolBar1 With .Items With .Add("",2) .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True .ShowCheckedAsSelected = 1 End With With .Add("Check 2") .Check = True .ShowCheckedAsSelected = 1 End With With .Add("Check 3") .Check = True .Checked = True .ShowCheckedAsSelected = 1 End With End With End With End With .Refresh End With
VB6
With ToolBar1 With .Items With .Add("",2) .GroupPopup = GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True .ShowCheckedAsSelected = exDisplayItemHighlight End With With .Add("Check 2") .Check = True .ShowCheckedAsSelected = exDisplayItemHighlight End With With .Add("Check 3") .Check = True .Checked = True .ShowCheckedAsSelected = exDisplayItemHighlight End With End With End With End With .Refresh End With
VB.NET
With Extoolbar1 With .Items With .Add("",2) .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight End With With .Add("Check 2") .Check = True .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight End With With .Add("Check 3") .Check = True .Checked = True .ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight End With End With End With End With .Refresh() End With
VB.NET for /COM
With AxToolBar1 With .Items With .Add("",2) .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame Or EXTOOLBARLib.GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight End With With .Add("Check 2") .Check = True .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight End With With .Add("Check 3") .Check = True .Checked = True .ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight End With End With End With End With .Refresh() End With
C++
/* Copy and paste the following directives to your header file as it defines the namespace 'EXTOOLBARLib' for the library: 'ExToolBar 1.0 Control Library' #import <ExToolBar.dll> using namespace EXTOOLBARLib; */ EXTOOLBARLib::IToolBarPtr spToolBar1 = GetDlgItem(IDC_TOOLBAR1)->GetControlUnknown(); EXTOOLBARLib::IItemsPtr var_Items = spToolBar1->GetItems(); EXTOOLBARLib::IItemPtr var_Item = var_Items->Add(L"",long(2),vtMissing); var_Item->PutGroupPopup(EXTOOLBARLib::GroupPopupEnum(EXTOOLBARLib::exNoGroupPopupFrame | EXTOOLBARLib::exGroupPopup)); EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems(); EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",vtMissing,vtMissing); var_Item1->PutCheck(VARIANT_TRUE); var_Item1->PutChecked(VARIANT_TRUE); var_Item1->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight); EXTOOLBARLib::IItemPtr var_Item2 = var_Items1->Add(L"Check 2",vtMissing,vtMissing); var_Item2->PutCheck(VARIANT_TRUE); var_Item2->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight); EXTOOLBARLib::IItemPtr var_Item3 = var_Items1->Add(L"Check 3",vtMissing,vtMissing); var_Item3->PutCheck(VARIANT_TRUE); var_Item3->PutChecked(VARIANT_TRUE); var_Item3->PutShowCheckedAsSelected(EXTOOLBARLib::exDisplayItemHighlight); spToolBar1->Refresh();
C++ Builder
Extoolbarlib_tlb::IItemsPtr var_Items = ToolBar1->Items; Extoolbarlib_tlb::IItemPtr var_Item = var_Items->Add(L"",TVariant(2),TNoParam()); var_Item->GroupPopup = Extoolbarlib_tlb::GroupPopupEnum::exNoGroupPopupFrame | Extoolbarlib_tlb::GroupPopupEnum::exGroupPopup; Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items; Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Check 1",TNoParam(),TNoParam()); var_Item1->Check = true; var_Item1->Checked = true; var_Item1->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight; Extoolbarlib_tlb::IItemPtr var_Item2 = var_Items1->Add(L"Check 2",TNoParam(),TNoParam()); var_Item2->Check = true; var_Item2->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight; Extoolbarlib_tlb::IItemPtr var_Item3 = var_Items1->Add(L"Check 3",TNoParam(),TNoParam()); var_Item3->Check = true; var_Item3->Checked = true; var_Item3->ShowCheckedAsSelected = Extoolbarlib_tlb::ShowCheckedAsSelectedEnum::exDisplayItemHighlight; ToolBar1->Refresh();
C#
exontrol.EXTOOLBARLib.Items var_Items = extoolbar1.Items; exontrol.EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null); var_Item.GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup; exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items; exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null); var_Item1.Check = true; var_Item1.Checked = true; var_Item1.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; exontrol.EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Check 2",null,null); var_Item2.Check = true; var_Item2.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; exontrol.EXTOOLBARLib.Item var_Item3 = var_Items1.Add("Check 3",null,null); var_Item3.Check = true; var_Item3.Checked = true; var_Item3.ShowCheckedAsSelected = exontrol.EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; extoolbar1.Refresh();
JScript/JavaScript
<BODY onload='Init()'> <OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_Items = ToolBar1.Items; var var_Item = var_Items.Add("",2,null); var_Item.GroupPopup = 3; var var_Items1 = var_Item.Items; var var_Item1 = var_Items1.Add("Check 1",null,null); var_Item1.Check = true; var_Item1.Checked = true; var_Item1.ShowCheckedAsSelected = 1; var var_Item2 = var_Items1.Add("Check 2",null,null); var_Item2.Check = true; var_Item2.ShowCheckedAsSelected = 1; var var_Item3 = var_Items1.Add("Check 3",null,null); var_Item3.Check = true; var_Item3.Checked = true; var_Item3.ShowCheckedAsSelected = 1; ToolBar1.Refresh(); } </SCRIPT> </BODY>
VBScript
<BODY onload='Init()'> <OBJECT CLASSID="clsid:DDF58CFA-750F-45E0-8A00-CFBE431702E2" id="ToolBar1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With ToolBar1 With .Items With .Add("",2) .GroupPopup = 3 ' GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup With .Items With .Add("Check 1") .Check = True .Checked = True .ShowCheckedAsSelected = 1 End With With .Add("Check 2") .Check = True .ShowCheckedAsSelected = 1 End With With .Add("Check 3") .Check = True .Checked = True .ShowCheckedAsSelected = 1 End With End With End With End With .Refresh End With End Function </SCRIPT> </BODY>
C# for /COM
EXTOOLBARLib.Items var_Items = axToolBar1.Items; EXTOOLBARLib.Item var_Item = var_Items.Add("",2,null); var_Item.GroupPopup = EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame | EXTOOLBARLib.GroupPopupEnum.exGroupPopup; EXTOOLBARLib.Items var_Items1 = var_Item.Items; EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Check 1",null,null); var_Item1.Check = true; var_Item1.Checked = true; var_Item1.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Check 2",null,null); var_Item2.Check = true; var_Item2.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; EXTOOLBARLib.Item var_Item3 = var_Items1.Add("Check 3",null,null); var_Item3.Check = true; var_Item3.Checked = true; var_Item3.ShowCheckedAsSelected = EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; axToolBar1.Refresh();
X++ (Dynamics Ax 2009)
public void init() { COM com_Item,com_Item1,com_Item2,com_Item3,com_Items,com_Items1; anytype var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1; ; super(); var_Items = extoolbar1.Items(); com_Items = var_Items; var_Item = com_Items.Add("",COMVariant::createFromInt(2)); com_Item = var_Item; com_Item.GroupPopup(3/*exNoGroupPopupFrame | exGroupPopup*/); var_Items1 = com_Item.Items(); com_Items1 = var_Items1; var_Item1 = com_Items1.Add("Check 1"); com_Item1 = var_Item1; com_Item1.Check(true); com_Item1.Checked(true); com_Item1.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/); var_Item2 = com_Items1.Add("Check 2"); com_Item2 = var_Item2; com_Item2.Check(true); com_Item2.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/); var_Item3 = com_Items1.Add("Check 3"); com_Item3 = var_Item3; com_Item3.Check(true); com_Item3.Checked(true); com_Item3.ShowCheckedAsSelected(1/*exDisplayItemHighlight*/); extoolbar1.Refresh(); }
Delphi 8 (.NET only)
with AxToolBar1 do begin with Items do begin with Add('',TObject(2),Nil) do begin GroupPopup := Integer(EXTOOLBARLib.GroupPopupEnum.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib.GroupPopupEnum.exGroupPopup); with Items do begin with Add('Check 1',Nil,Nil) do begin Check := True; Checked := True; ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; end; with Add('Check 2',Nil,Nil) do begin Check := True; ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; end; with Add('Check 3',Nil,Nil) do begin Check := True; Checked := True; ShowCheckedAsSelected := EXTOOLBARLib.ShowCheckedAsSelectedEnum.exDisplayItemHighlight; end; end; end; end; Refresh(); end
Delphi (standard)
with ToolBar1 do begin with Items do begin with Add('',OleVariant(2),Null) do begin GroupPopup := Integer(EXTOOLBARLib_TLB.exNoGroupPopupFrame) Or Integer(EXTOOLBARLib_TLB.exGroupPopup); with Items do begin with Add('Check 1',Null,Null) do begin Check := True; Checked := True; ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight; end; with Add('Check 2',Null,Null) do begin Check := True; ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight; end; with Add('Check 3',Null,Null) do begin Check := True; Checked := True; ShowCheckedAsSelected := EXTOOLBARLib_TLB.exDisplayItemHighlight; end; end; end; end; Refresh(); end
VFP
with thisform.ToolBar1 with .Items with .Add("",2) .GroupPopup = 3 && GroupPopupEnum.exNoGroupPopupFrame Or GroupPopupEnum.exGroupPopup with .Items with .Add("Check 1") .Check = .T. .Checked = .T. .ShowCheckedAsSelected = 1 endwith with .Add("Check 2") .Check = .T. .ShowCheckedAsSelected = 1 endwith with .Add("Check 3") .Check = .T. .Checked = .T. .ShowCheckedAsSelected = 1 endwith endwith endwith endwith .Refresh endwith
dBASE Plus
local oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1 oToolBar = form.Activex1.nativeObject var_Items = oToolBar.Items var_Item = var_Items.Add("",2) var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/ var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Check 1") var_Item1.Check = true var_Item1.Checked = true var_Item1.ShowCheckedAsSelected = 1 var_Item2 = var_Items1.Add("Check 2") var_Item2.Check = true var_Item2.ShowCheckedAsSelected = 1 var_Item3 = var_Items1.Add("Check 3") var_Item3.Check = true var_Item3.Checked = true var_Item3.ShowCheckedAsSelected = 1 oToolBar.Refresh()
XBasic (Alpha Five)
Dim oToolBar as P Dim var_Item as P Dim var_Item1 as P Dim var_Item2 as P Dim var_Item3 as P Dim var_Items as P Dim var_Items1 as P oToolBar = topparent:CONTROL_ACTIVEX1.activex var_Items = oToolBar.Items var_Item = var_Items.Add("",2) var_Item.GroupPopup = 3 'exNoGroupPopupFrame + exGroupPopup var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Check 1") var_Item1.Check = .t. var_Item1.Checked = .t. var_Item1.ShowCheckedAsSelected = 1 var_Item2 = var_Items1.Add("Check 2") var_Item2.Check = .t. var_Item2.ShowCheckedAsSelected = 1 var_Item3 = var_Items1.Add("Check 3") var_Item3.Check = .t. var_Item3.Checked = .t. var_Item3.ShowCheckedAsSelected = 1 oToolBar.Refresh()
Visual Objects
local var_Item,var_Item1,var_Item2,var_Item3 as IItem local var_Items,var_Items1 as IItems var_Items := oDCOCX_Exontrol1:Items var_Item := var_Items:Add("",2,nil) var_Item:GroupPopup := exNoGroupPopupFrame | exGroupPopup var_Items1 := var_Item:Items var_Item1 := var_Items1:Add("Check 1",nil,nil) var_Item1:Check := true var_Item1:Checked := true var_Item1:ShowCheckedAsSelected := exDisplayItemHighlight var_Item2 := var_Items1:Add("Check 2",nil,nil) var_Item2:Check := true var_Item2:ShowCheckedAsSelected := exDisplayItemHighlight var_Item3 := var_Items1:Add("Check 3",nil,nil) var_Item3:Check := true var_Item3:Checked := true var_Item3:ShowCheckedAsSelected := exDisplayItemHighlight oDCOCX_Exontrol1:Refresh()
PowerBuilder
OleObject oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Items,var_Items1 oToolBar = ole_1.Object var_Items = oToolBar.Items var_Item = var_Items.Add("",2) var_Item.GroupPopup = 3 /*exNoGroupPopupFrame | exGroupPopup*/ var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Check 1") var_Item1.Check = true var_Item1.Checked = true var_Item1.ShowCheckedAsSelected = 1 var_Item2 = var_Items1.Add("Check 2") var_Item2.Check = true var_Item2.ShowCheckedAsSelected = 1 var_Item3 = var_Items1.Add("Check 3") var_Item3.Check = true var_Item3.Checked = true var_Item3.ShowCheckedAsSelected = 1 oToolBar.Refresh()
Visual DataFlex
Procedure OnCreate Forward Send OnCreate Variant voItems Get ComItems to voItems Handle hoItems Get Create (RefClass(cComItems)) to hoItems Set pvComObject of hoItems to voItems Variant voItem Get ComAdd of hoItems "" 2 Nothing to voItem Handle hoItem Get Create (RefClass(cComItem)) to hoItem Set pvComObject of hoItem to voItem Set ComGroupPopup of hoItem to (OLEexNoGroupPopupFrame + OLEexGroupPopup) Variant voItems1 Get ComItems of hoItem to voItems1 Handle hoItems1 Get Create (RefClass(cComItems)) to hoItems1 Set pvComObject of hoItems1 to voItems1 Variant voItem1 Get ComAdd of hoItems1 "Check 1" Nothing Nothing to voItem1 Handle hoItem1 Get Create (RefClass(cComItem)) to hoItem1 Set pvComObject of hoItem1 to voItem1 Set ComCheck of hoItem1 to True Set ComChecked of hoItem1 to True Set ComShowCheckedAsSelected of hoItem1 to OLEexDisplayItemHighlight Send Destroy to hoItem1 Variant voItem2 Get ComAdd of hoItems1 "Check 2" Nothing Nothing to voItem2 Handle hoItem2 Get Create (RefClass(cComItem)) to hoItem2 Set pvComObject of hoItem2 to voItem2 Set ComCheck of hoItem2 to True Set ComShowCheckedAsSelected of hoItem2 to OLEexDisplayItemHighlight Send Destroy to hoItem2 Variant voItem3 Get ComAdd of hoItems1 "Check 3" Nothing Nothing to voItem3 Handle hoItem3 Get Create (RefClass(cComItem)) to hoItem3 Set pvComObject of hoItem3 to voItem3 Set ComCheck of hoItem3 to True Set ComChecked of hoItem3 to True Set ComShowCheckedAsSelected of hoItem3 to OLEexDisplayItemHighlight Send Destroy to hoItem3 Send Destroy to hoItems1 Send Destroy to hoItem Send Destroy to hoItems Send ComRefresh End_Procedure
XBase++
#include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oItem,oItem1,oItem2,oItem3 LOCAL oItems,oItems1 LOCAL oToolBar oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oToolBar := XbpActiveXControl():new( oForm:drawingArea ) oToolBar:CLSID := "Exontrol.ToolBar.1" /*{DDF58CFA-750F-45E0-8A00-CFBE431702E2}*/ oToolBar:create(,, {10,60},{610,370} ) oItems := oToolBar:Items() oItem := oItems:Add("",2) oItem:GroupPopup := 3/*exNoGroupPopupFrame+exGroupPopup*/ oItems1 := oItem:Items() oItem1 := oItems1:Add("Check 1") oItem1:Check := .T. oItem1:Checked := .T. oItem1:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/ oItem2 := oItems1:Add("Check 2") oItem2:Check := .T. oItem2:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/ oItem3 := oItems1:Add("Check 3") oItem3:Check := .T. oItem3:Checked := .T. oItem3:ShowCheckedAsSelected := 1/*exDisplayItemHighlight*/ oToolBar:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN