GrapeCity CalendarGrid for Windows Forms 2.0J
VerticalLayoutInfo プロパティ
使用例 

GcCalendarGrid の行のレイアウト情報を取得します。
構文
Public ReadOnly Property VerticalLayoutInfo As IList(Of LayoutInfo)
public IList<LayoutInfo> VerticalLayoutInfo {get;}
解説
このコレクションから行の高さと表示/非表示を取得できます。
使用例
次のサンプルコードは、列の平均リサイズ機能の実装方法を示します。このサンプルコードは、GcCalendarGrid.ResizeMode プロパティに示されている詳細なコード例の一部を抜粋したものです。
void gcCalendarGrid1_ResizeCompleting(object sender, GrapeCity.Win.CalendarGrid.CalendarResizeCompletingEventArgs e)
{
    if (e.Direction == Orientation.Horizontal)
    {
        if (((e.LayoutIndex + 1) % 2) == 0)
        {
            e.Handled = true;

            int prevWidth = this.gcCalendarGrid.LayoutSettings.HorizontalLayoutInfo[e.LayoutIndex - 1].Length;
            int currWidth = this.gcCalendarGrid.LayoutSettings.HorizontalLayoutInfo[e.LayoutIndex].Length;

            int halfOffset = e.ResizeOffset / 2;

            this.gcCalendarGrid.LayoutSettings.SetHorizontalLength(e.LayoutIndex - 1, prevWidth + halfOffset);
            this.gcCalendarGrid.LayoutSettings.SetHorizontalLength(e.LayoutIndex, prevWidth + halfOffset);
        }
    }
}
Private Sub gcCalendarGrid1_ResizeCompleting(sender As Object, e As GrapeCity.Win.CalendarGrid.CalendarResizeCompletingEventArgs)
    If e.Direction = Orientation.Horizontal Then
        If ((e.LayoutIndex + 1) Mod 2) = 0 Then
            e.Handled = True

            Dim prevWidth As Integer = Me.gcCalendarGrid.LayoutSettings.HorizontalLayoutInfo(e.LayoutIndex - 1).Length
            Dim currWidth As Integer = Me.gcCalendarGrid.LayoutSettings.HorizontalLayoutInfo(e.LayoutIndex).Length

            Dim halfOffset As Integer = e.ResizeOffset / 2

            Me.gcCalendarGrid.LayoutSettings.SetHorizontalLength(e.LayoutIndex - 1, prevWidth + halfOffset)
            Me.gcCalendarGrid.LayoutSettings.SetHorizontalLength(e.LayoutIndex, prevWidth + halfOffset)
        End If
    End If
End Sub
参照

CalendarGridLayoutSettings クラス
CalendarGridLayoutSettings メンバ

 

 


c 2008 GrapeCity inc. All rights reserved.