PowerTools CalendarGrid for Windows Forms 1.0J
NavigationBar プロパティ
使用例 

GcCalendarGrid のナビゲーションバーを取得します。
構文
Public ReadOnly Property NavigationBar As CalendarNavigationBar
public CalendarNavigationBar NavigationBar {get;}

プロパティ値

ナビゲーションバーを表す CalendarNavigationBar オブジェクト。
使用例
次のサンプルコードは、GcCalendarGridCalendarNavigationBar を使用する方法を示します。
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GrapeCity.Win.CalendarGrid;

namespace CalendarGridSampleCode
{
    public class NavigationBarDemo : Form
    {
        private GcCalendarGrid gcCalendarGrid1 = new GcCalendarGrid();
        private TableLayoutPanel tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
        private TableLayoutPanel tableLayoutPanel2 = new TableLayoutPanel();
        private Button button1 = new Button();
        private Button button2 = new Button();
        private Button button3 = new Button();
        private Button button4 = new Button();

        public NavigationBarDemo()
        {
            this.tableLayoutPanel1.ColumnCount = 1;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 2;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 90F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(554, 426);

            this.gcCalendarGrid1.Dock = DockStyle.Fill;
            this.gcCalendarGrid1.TitleHeader.Children.Clear();
            this.tableLayoutPanel1.Controls.Add(this.gcCalendarGrid1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 1);

            this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button1.Text = "ShowNavigationBar";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += ShowNavigationBar;

            this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button2.Text = "SetNavigationBarProperty";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += SetNavigationBarProperty;

            this.button3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button3.Text = "AddBottonRightButtons";
            this.button3.UseVisualStyleBackColor = true;
            this.button3.Click += AddBottonRightButtons;

            this.button4.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button4.Text = "AddTopLeftButtons";
            this.button4.UseVisualStyleBackColor = true;
            this.button4.Click += AddTopLeftButtons;

            this.tableLayoutPanel2.ColumnCount = 4;
            this.tableLayoutPanel2.RowCount = 1;
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25f));
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25f));
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25f));
            this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25f));
            this.tableLayoutPanel2.Controls.Add(this.button1, 0, 0);
            this.tableLayoutPanel2.Controls.Add(this.button2, 1, 0);
            this.tableLayoutPanel2.Controls.Add(this.button3, 2, 0);
            this.tableLayoutPanel2.Controls.Add(this.button4, 3, 0);
            this.tableLayoutPanel2.Dock = DockStyle.Fill;

            this.Text = "Navigation Demo";
            this.Size = new Size(800, 700);
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Controls.Add(this.tableLayoutPanel1);
        }

        private void ShowNavigationBar(object sender, EventArgs e)
        {
            this.ShowNavigationBar();
        }

        private void SetNavigationBarProperty(object sender, EventArgs e)
        {
            this.SetNavigationBarProperty();
        }

        private void AddBottonRightButtons(object sender, EventArgs e)
        {
            this.AddBottonRightButtons();
        }

        private void AddTopLeftButtons(object sender, EventArgs e)
        {
            this.AddTopLeftButtons();
        }

        private void ShowNavigationBar()
        {
            this.gcCalendarGrid1.NavigationBar.Visible = true;
        }

        private void SetNavigationBarProperty()
        {
            this.gcCalendarGrid1.NavigationBar.Position = NavigationBarPosition.Bottom;
            this.gcCalendarGrid1.NavigationBar.Width = 30;
            this.gcCalendarGrid1.NavigationBar.ShowScrollToolTip = true;
            this.gcCalendarGrid1.NavigationBar.ScrollOnThumbTrack = true;
        }

        private void AddBottonRightButtons()
        {
            CalendarNavigationButton calendarNavigationButton1 = new CalendarNavigationButton();
            calendarNavigationButton1.ButtonBehavior = GrapeCity.Win.CalendarGrid.CalendarTitleButtonBehavior.Next;
            calendarNavigationButton1.DateFormat = "{LongDate}";
            calendarNavigationButton1.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption;
            calendarNavigationButton1.FlatAppearance.BorderSize = 2;
            calendarNavigationButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            calendarNavigationButton1.Text = "";
            calendarNavigationButton1.ToolTipText = "{0}";
            this.gcCalendarGrid1.NavigationBar.BottomRightButtons.Add(calendarNavigationButton1);            
        }

        private void AddTopLeftButtons()
        {
            CalendarNavigationButton calendarNavigationButton1 = new CalendarNavigationButton();
            calendarNavigationButton1.ButtonBehavior = GrapeCity.Win.CalendarGrid.CalendarTitleButtonBehavior.Previous;
            calendarNavigationButton1.DateFormat = "{LongDate}";
            calendarNavigationButton1.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption;
            calendarNavigationButton1.FlatAppearance.BorderSize = 2;
            calendarNavigationButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            calendarNavigationButton1.Text = "";
            calendarNavigationButton1.ToolTipText = "{0}";
            this.gcCalendarGrid1.NavigationBar.TopLeftButtons.Add(calendarNavigationButton1);
        }

        [STAThreadAttribute]
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new NavigationBarDemo());
        }
    }
}
Imports System.Collections.Generic
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms
Imports GrapeCity.Win.CalendarGrid

Namespace CalendarGridSampleCode
    Public Class NavigationBarDemo
        Inherits Form
        Private gcCalendarGrid1 As New GcCalendarGrid()
        Private tableLayoutPanel1 As TableLayoutPanel = New System.Windows.Forms.TableLayoutPanel()
        Private tableLayoutPanel2 As New TableLayoutPanel()
        Private button1 As New Button()
        Private button2 As New Button()
        Private button3 As New Button()
        Private button4 As New Button()

        Public Sub New()
            Me.tableLayoutPanel1.ColumnCount = 1
            Me.tableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0F))
            Me.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.tableLayoutPanel1.Location = New System.Drawing.Point(0, 0)
            Me.tableLayoutPanel1.Name = "tableLayoutPanel1"
            Me.tableLayoutPanel1.RowCount = 2
            Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 90.0F))
            Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10.0F))
            Me.tableLayoutPanel1.Size = New System.Drawing.Size(554, 426)

            Me.gcCalendarGrid1.Dock = DockStyle.Fill
            Me.gcCalendarGrid1.TitleHeader.Children.Clear()
            Me.tableLayoutPanel1.Controls.Add(Me.gcCalendarGrid1, 0, 0)
            Me.tableLayoutPanel1.Controls.Add(Me.tableLayoutPanel2, 0, 1)

            Me.button1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.button1.Text = "ShowNavigationBar"
            Me.button1.UseVisualStyleBackColor = True
            AddHandler Me.button1.Click, AddressOf ShowNavigationBar

            Me.button2.Dock = System.Windows.Forms.DockStyle.Fill
            Me.button2.Text = "SetNavigationBarProperty"
            Me.button2.UseVisualStyleBackColor = True
            AddHandler Me.button2.Click, AddressOf SetNavigationBarProperty

            Me.button3.Dock = System.Windows.Forms.DockStyle.Fill
            Me.button3.Text = "AddBottonRightButtons"
            Me.button3.UseVisualStyleBackColor = True
            AddHandler Me.button3.Click, AddressOf AddBottonRightButtons

            Me.button4.Dock = System.Windows.Forms.DockStyle.Fill
            Me.button4.Text = "AddTopLeftButtons"
            Me.button4.UseVisualStyleBackColor = True
            AddHandler Me.button4.Click, AddressOf AddTopLeftButtons

            Me.tableLayoutPanel2.ColumnCount = 4
            Me.tableLayoutPanel2.RowCount = 1
            Me.tableLayoutPanel2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0F))
            Me.tableLayoutPanel2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0F))
            Me.tableLayoutPanel2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0F))
            Me.tableLayoutPanel2.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25.0F))
            Me.tableLayoutPanel2.Controls.Add(Me.button1, 0, 0)
            Me.tableLayoutPanel2.Controls.Add(Me.button2, 1, 0)
            Me.tableLayoutPanel2.Controls.Add(Me.button3, 2, 0)
            Me.tableLayoutPanel2.Controls.Add(Me.button4, 3, 0)
            Me.tableLayoutPanel2.Dock = DockStyle.Fill

            Me.Text = "Navigation Demo"
            Me.Size = New Size(800, 700)
            Me.StartPosition = FormStartPosition.CenterScreen
            Me.Controls.Add(Me.tableLayoutPanel1)
        End Sub

        Private Sub ShowNavigationBar(sender As Object, e As EventArgs)
            Me.ShowNavigationBar()
        End Sub

        Private Sub SetNavigationBarProperty(sender As Object, e As EventArgs)
            Me.SetNavigationBarProperty()
        End Sub

        Private Sub AddBottonRightButtons(sender As Object, e As EventArgs)
            Me.AddBottonRightButtons()
        End Sub

        Private Sub AddTopLeftButtons(sender As Object, e As EventArgs)
            Me.AddTopLeftButtons()
        End Sub

        Private Sub ShowNavigationBar()
            Me.gcCalendarGrid1.NavigationBar.Visible = True
        End Sub

        Private Sub SetNavigationBarProperty()
            Me.gcCalendarGrid1.NavigationBar.Position = NavigationBarPosition.Bottom
            Me.gcCalendarGrid1.NavigationBar.Width = 30
            Me.gcCalendarGrid1.NavigationBar.ShowScrollToolTip = True
            Me.gcCalendarGrid1.NavigationBar.ScrollOnThumbTrack = True
        End Sub

        Private Sub AddBottonRightButtons()
            Dim calendarNavigationButton1 As New CalendarNavigationButton()
            calendarNavigationButton1.ButtonBehavior = GrapeCity.Win.CalendarGrid.CalendarTitleButtonBehavior.[Next]
            calendarNavigationButton1.DateFormat = "{LongDate}"
            calendarNavigationButton1.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption
            calendarNavigationButton1.FlatAppearance.BorderSize = 2
            calendarNavigationButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
            calendarNavigationButton1.Text = ""
            calendarNavigationButton1.ToolTipText = "{0}"
            Me.gcCalendarGrid1.NavigationBar.BottomRightButtons.Add(calendarNavigationButton1)
        End Sub

        Private Sub AddTopLeftButtons()
            Dim calendarNavigationButton1 As New CalendarNavigationButton()
            calendarNavigationButton1.ButtonBehavior = GrapeCity.Win.CalendarGrid.CalendarTitleButtonBehavior.Previous
            calendarNavigationButton1.DateFormat = "{LongDate}"
            calendarNavigationButton1.FlatAppearance.BorderColor = System.Drawing.SystemColors.ActiveCaption
            calendarNavigationButton1.FlatAppearance.BorderSize = 2
            calendarNavigationButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
            calendarNavigationButton1.Text = ""
            calendarNavigationButton1.ToolTipText = "{0}"
            Me.gcCalendarGrid1.NavigationBar.TopLeftButtons.Add(calendarNavigationButton1)
        End Sub

        <STAThreadAttribute> _
        Public Shared Sub Main()
            Application.EnableVisualStyles()
            Application.Run(New NavigationBarDemo())
        End Sub
    End Class
End Namespace
参照

GcCalendarGrid クラス
GcCalendarGrid メンバ

 

 


© 2014 GrapeCity inc. All rights reserved.