BaseClass を直接 ToolbarControl に追加する方法

 2016/9/1 (木)    

Dim pCommand(2) As ICommand
pCommand(0) = New PrintSettings
pCommand(1) = New PrintPreview
pCommand(2) = New Print
 
Dim pToolbarControl As IToolbarControl = CType(axToolbarControl1.Object, IToolbarControl)
 
For i As Integer = 0 To pCommand.Length - 1
    axToolbarControl1.AddItem(pCommand[i], 0, axToolbarControl1.Count, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
Next i
 
 
 
 
ICommand[] pCommand = new ICommand[3];
pCommand[0] = new PrintSettings();
pCommand[1] = new PrintPreview();
pCommand[2] = new Print();
 
IToolbarControl pToolbarControl = (IToolbarControl)axToolbarControl1.Object;
 
for (int i = 0; i <= pCommand.Length - 1; i++) {
    axToolbarControl1.AddItem(pCommand(i), 0, axToolbarControl1.Count, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
}

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.