PowerTools ActiveReports for .NET 11.0J
AddRange メソッド (ControlCollection)
使用例 

コレクションに追加する ARControl オブジェクトの配列。
ARControlオブジェクトの配列をコレクションに追加します。
構文
'宣言
 
Public Sub AddRange( _
   ByVal controls() As ARControl _
) 
public void AddRange( 
   ARControl[] controls
)

パラメータ

controls
コレクションに追加する ARControl オブジェクトの配列。
解説

配列内の ARControl オブジェクトがコレクションの末尾に追加されます。

使用例
private void SectionReport1_ReportStart(object sender, System.EventArgs eArgs)
{
    //コントロールの配列を作成する
    //配列の初期化は1ベースですが、配列のアクセスはゼロベースです。
    ARControl[] arr = new ARControl[3];
    GrapeCity.ActiveReports.SectionReportModel.CheckBox c = new GrapeCity.ActiveReports.SectionReportModel.CheckBox();
    GrapeCity.ActiveReports.SectionReportModel.Label l = new GrapeCity.ActiveReports.SectionReportModel.Label();
    GrapeCity.ActiveReports.SectionReportModel.TextBox t = new GrapeCity.ActiveReports.SectionReportModel.TextBox();
    //コントロールのプロパティを設定する。
    c.Text = "Checkbox";
    l.Left = 1;
    l.Value = "LabelValue";
    t.Left = 2;
    t.Text = "TextBox";
    //コントロールを配列に割り当てる。
    arr[0] = c;
    arr[1] = l;
    arr[2] = t;
    //レポートの最初のセクションにコントロールのレンジを追加する。
    this.Sections[0].Controls.AddRange(arr);
}
Private Sub SectionReport1_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.ReportStart
    'コントロールの配列を作成する
    Dim arr(2) As ARControl
    Dim c As New GrapeCity.ActiveReports.SectionReportModel.CheckBox
    Dim l As New GrapeCity.ActiveReports.SectionReportModel.Label
    Dim t As New GrapeCity.ActiveReports.SectionReportModel.TextBox
    'コントロールのプロパティを設定する。
    c.Text = "Checkbox"
    l.Left = 1
    l.Text = "Label"
    t.Left = 2
    t.Text = "TextBox"
    'コントロールを配列に割り当てる。
    arr(0) = c
    arr(1) = l
    arr(2) = t
    'レポートの最初のセクションにコントロールのレンジを追加する。
    Me.Sections(0).Controls.AddRange(arr)
End Sub
参照

関連項目

ControlCollection クラス
ControlCollection メンバ
Add メソッド

 

 


©2003-2017 GrapeCity inc. All rights reserved.