Type | Description | |||
Boolean | A Boolean expression that specifies whether the item displays a radio button. |
How can I add radio buttons to items?
VBA (MS Access, Excell...)
With ToolBar1 With .Items With .Add("",2) .GroupPopup = 1 With .Items With .Add("Radio 1",0,1000) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1001) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1003) .Radio = True .RadioGroup = 100 End With .Item(1000).Checked = True End With End With End With .Refresh End With
VB6
With ToolBar1 With .Items With .Add("",2) .GroupPopup = exGroupPopup With .Items With .Add("Radio 1",0,1000) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1001) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1003) .Radio = True .RadioGroup = 100 End With .Item(1000).Checked = True End With End With End With .Refresh End With
VB.NET
With Extoolbar1 With .Items With .Add("",2) .GroupPopup = exontrol.EXTOOLBARLib.GroupPopupEnum.exGroupPopup With .Items With .Add("Radio 1",0,1000) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1001) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1003) .Radio = True .RadioGroup = 100 End With .Item(1000).Checked = True End With End With End With .Refresh() End With
VB.NET for /COM
With AxToolBar1 With .Items With .Add("",2) .GroupPopup = EXTOOLBARLib.GroupPopupEnum.exGroupPopup With .Items With .Add("Radio 1",0,1000) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1001) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1003) .Radio = True .RadioGroup = 100 End With .Item(1000).Checked = True 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::exGroupPopup); EXTOOLBARLib::IItemsPtr var_Items1 = var_Item->GetItems(); EXTOOLBARLib::IItemPtr var_Item1 = var_Items1->Add(L"Radio 1",long(0),long(1000)); var_Item1->PutRadio(VARIANT_TRUE); var_Item1->PutRadioGroup(100); EXTOOLBARLib::IItemPtr var_Item2 = var_Items1->Add(L"Radio 2",long(0),long(1001)); var_Item2->PutRadio(VARIANT_TRUE); var_Item2->PutRadioGroup(100); EXTOOLBARLib::IItemPtr var_Item3 = var_Items1->Add(L"Radio 2",long(0),long(1003)); var_Item3->PutRadio(VARIANT_TRUE); var_Item3->PutRadioGroup(100); var_Items1->GetItem(long(1000))->PutChecked(VARIANT_TRUE); 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::exGroupPopup; Extoolbarlib_tlb::IItemsPtr var_Items1 = var_Item->Items; Extoolbarlib_tlb::IItemPtr var_Item1 = var_Items1->Add(L"Radio 1",TVariant(0),TVariant(1000)); var_Item1->Radio = true; var_Item1->RadioGroup = 100; Extoolbarlib_tlb::IItemPtr var_Item2 = var_Items1->Add(L"Radio 2",TVariant(0),TVariant(1001)); var_Item2->Radio = true; var_Item2->RadioGroup = 100; Extoolbarlib_tlb::IItemPtr var_Item3 = var_Items1->Add(L"Radio 2",TVariant(0),TVariant(1003)); var_Item3->Radio = true; var_Item3->RadioGroup = 100; var_Items1->get_Item(TVariant(1000))->Checked = true; 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.exGroupPopup; exontrol.EXTOOLBARLib.Items var_Items1 = var_Item.Items; exontrol.EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 1",0,1000); var_Item1.Radio = true; var_Item1.RadioGroup = 100; exontrol.EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Radio 2",0,1001); var_Item2.Radio = true; var_Item2.RadioGroup = 100; exontrol.EXTOOLBARLib.Item var_Item3 = var_Items1.Add("Radio 2",0,1003); var_Item3.Radio = true; var_Item3.RadioGroup = 100; var_Items1[1000].Checked = true; 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 = 1; var var_Items1 = var_Item.Items; var var_Item1 = var_Items1.Add("Radio 1",0,1000); var_Item1.Radio = true; var_Item1.RadioGroup = 100; var var_Item2 = var_Items1.Add("Radio 2",0,1001); var_Item2.Radio = true; var_Item2.RadioGroup = 100; var var_Item3 = var_Items1.Add("Radio 2",0,1003); var_Item3.Radio = true; var_Item3.RadioGroup = 100; var_Items1.Item(1000).Checked = true; 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 = 1 With .Items With .Add("Radio 1",0,1000) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1001) .Radio = True .RadioGroup = 100 End With With .Add("Radio 2",0,1003) .Radio = True .RadioGroup = 100 End With .Item(1000).Checked = True 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.exGroupPopup; EXTOOLBARLib.Items var_Items1 = var_Item.Items; EXTOOLBARLib.Item var_Item1 = var_Items1.Add("Radio 1",0,1000); var_Item1.Radio = true; var_Item1.RadioGroup = 100; EXTOOLBARLib.Item var_Item2 = var_Items1.Add("Radio 2",0,1001); var_Item2.Radio = true; var_Item2.RadioGroup = 100; EXTOOLBARLib.Item var_Item3 = var_Items1.Add("Radio 2",0,1003); var_Item3.Radio = true; var_Item3.RadioGroup = 100; var_Items1[1000].Checked = true; axToolBar1.Refresh();
X++ (Dynamics Ax 2009)
public void init() { COM com_Item,com_Item1,com_Item2,com_Item3,com_Item4,com_Items,com_Items1; anytype var_Item,var_Item1,var_Item2,var_Item3,var_Item4,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(1/*exGroupPopup*/); var_Items1 = com_Item.Items(); com_Items1 = var_Items1; var_Item1 = com_Items1.Add("Radio 1",COMVariant::createFromInt(0),COMVariant::createFromInt(1000)); com_Item1 = var_Item1; com_Item1.Radio(true); com_Item1.RadioGroup(100); var_Item2 = com_Items1.Add("Radio 2",COMVariant::createFromInt(0),COMVariant::createFromInt(1001)); com_Item2 = var_Item2; com_Item2.Radio(true); com_Item2.RadioGroup(100); var_Item3 = com_Items1.Add("Radio 2",COMVariant::createFromInt(0),COMVariant::createFromInt(1003)); com_Item3 = var_Item3; com_Item3.Radio(true); com_Item3.RadioGroup(100); var_Item4 = COM::createFromObject(com_Items1.Item(COMVariant::createFromInt(1000))); com_Item4 = var_Item4; com_Item4.Checked(true); extoolbar1.Refresh(); }
Delphi 8 (.NET only)
with AxToolBar1 do begin with Items do begin with Add('',TObject(2),Nil) do begin GroupPopup := EXTOOLBARLib.GroupPopupEnum.exGroupPopup; with Items do begin with Add('Radio 1',TObject(0),TObject(1000)) do begin Radio := True; RadioGroup := 100; end; with Add('Radio 2',TObject(0),TObject(1001)) do begin Radio := True; RadioGroup := 100; end; with Add('Radio 2',TObject(0),TObject(1003)) do begin Radio := True; RadioGroup := 100; end; Item[TObject(1000)].Checked := True; end; end; end; Refresh(); end
Delphi (standard)
with ToolBar1 do begin with Items do begin with Add('',OleVariant(2),Null) do begin GroupPopup := EXTOOLBARLib_TLB.exGroupPopup; with Items do begin with Add('Radio 1',OleVariant(0),OleVariant(1000)) do begin Radio := True; RadioGroup := 100; end; with Add('Radio 2',OleVariant(0),OleVariant(1001)) do begin Radio := True; RadioGroup := 100; end; with Add('Radio 2',OleVariant(0),OleVariant(1003)) do begin Radio := True; RadioGroup := 100; end; Item[OleVariant(1000)].Checked := True; end; end; end; Refresh(); end
VFP
with thisform.ToolBar1 with .Items with .Add("",2) .GroupPopup = 1 with .Items with .Add("Radio 1",0,1000) .Radio = .T. .RadioGroup = 100 endwith with .Add("Radio 2",0,1001) .Radio = .T. .RadioGroup = 100 endwith with .Add("Radio 2",0,1003) .Radio = .T. .RadioGroup = 100 endwith .Item(1000).Checked = .T. endwith endwith endwith .Refresh endwith
dBASE Plus
local oToolBar,var_Item,var_Item1,var_Item2,var_Item3,var_Item4,var_Items,var_Items1 oToolBar = form.Activex1.nativeObject var_Items = oToolBar.Items var_Item = var_Items.Add("",2) var_Item.GroupPopup = 1 var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Radio 1",0,1000) var_Item1.Radio = true var_Item1.RadioGroup = 100 var_Item2 = var_Items1.Add("Radio 2",0,1001) var_Item2.Radio = true var_Item2.RadioGroup = 100 var_Item3 = var_Items1.Add("Radio 2",0,1003) var_Item3.Radio = true var_Item3.RadioGroup = 100 // var_Items1.Item(1000).Checked = true var_Item4 = var_Items1.Item(1000) with (oToolBar) TemplateDef = [Dim var_Item4] TemplateDef = var_Item4 Template = [var_Item4.Checked = true] endwith 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_Item4 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 = 1 var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Radio 1",0,1000) var_Item1.Radio = .t. var_Item1.RadioGroup = 100 var_Item2 = var_Items1.Add("Radio 2",0,1001) var_Item2.Radio = .t. var_Item2.RadioGroup = 100 var_Item3 = var_Items1.Add("Radio 2",0,1003) var_Item3.Radio = .t. var_Item3.RadioGroup = 100 ' var_Items1.Item(1000).Checked = .t. var_Item4 = var_Items1.Item(1000) oToolBar.TemplateDef = "Dim var_Item4" oToolBar.TemplateDef = var_Item4 oToolBar.Template = "var_Item4.Checked = True" 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 := exGroupPopup var_Items1 := var_Item:Items var_Item1 := var_Items1:Add("Radio 1",0,1000) var_Item1:Radio := true var_Item1:RadioGroup := 100 var_Item2 := var_Items1:Add("Radio 2",0,1001) var_Item2:Radio := true var_Item2:RadioGroup := 100 var_Item3 := var_Items1:Add("Radio 2",0,1003) var_Item3:Radio := true var_Item3:RadioGroup := 100 var_Items1:[Item,1000]:Checked := true 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 = 1 var_Items1 = var_Item.Items var_Item1 = var_Items1.Add("Radio 1",0,1000) var_Item1.Radio = true var_Item1.RadioGroup = 100 var_Item2 = var_Items1.Add("Radio 2",0,1001) var_Item2.Radio = true var_Item2.RadioGroup = 100 var_Item3 = var_Items1.Add("Radio 2",0,1003) var_Item3.Radio = true var_Item3.RadioGroup = 100 var_Items1.Item(1000).Checked = true 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 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 "Radio 1" 0 1000 to voItem1 Handle hoItem1 Get Create (RefClass(cComItem)) to hoItem1 Set pvComObject of hoItem1 to voItem1 Set ComRadio of hoItem1 to True Set ComRadioGroup of hoItem1 to 100 Send Destroy to hoItem1 Variant voItem2 Get ComAdd of hoItems1 "Radio 2" 0 1001 to voItem2 Handle hoItem2 Get Create (RefClass(cComItem)) to hoItem2 Set pvComObject of hoItem2 to voItem2 Set ComRadio of hoItem2 to True Set ComRadioGroup of hoItem2 to 100 Send Destroy to hoItem2 Variant voItem3 Get ComAdd of hoItems1 "Radio 2" 0 1003 to voItem3 Handle hoItem3 Get Create (RefClass(cComItem)) to hoItem3 Set pvComObject of hoItem3 to voItem3 Set ComRadio of hoItem3 to True Set ComRadioGroup of hoItem3 to 100 Send Destroy to hoItem3 Variant voItem4 Get ComItem of hoItems1 1000 to voItem4 Handle hoItem4 Get Create (RefClass(cComItem)) to hoItem4 Set pvComObject of hoItem4 to voItem4 Set ComChecked of hoItem4 to True Send Destroy to hoItem4 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 := 1/*exGroupPopup*/ oItems1 := oItem:Items() oItem1 := oItems1:Add("Radio 1",0,1000) oItem1:Radio := .T. oItem1:RadioGroup := 100 oItem2 := oItems1:Add("Radio 2",0,1001) oItem2:Radio := .T. oItem2:RadioGroup := 100 oItem3 := oItems1:Add("Radio 2",0,1003) oItem3:Radio := .T. oItem3:RadioGroup := 100 oItems1:Item(1000):Checked := .T. oToolBar:Refresh() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN