PowerTools MultiRow for Windows Forms 8.0J
StickyCell クラス
メンバ  使用例 

ユーザーが設定したイベントが近づいたときにリマインダーを表示できる StickyCell を表します。ユーザーは組み込みフォーム、または Popup によって設定されたユーザーフォームを使用してイベントを編集できます。
構文
Public Class StickyCell 
   Inherits Cell
   Implements IEditingCell 
public class StickyCell : Cell, IEditingCell  
使用例
次のサンプルコードは、付箋型セルの使用方法を示します。
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GrapeCity.Win.MultiRow.SampleCode
{
    public class StickyCellDemo:Form
    {
        private GcMultiRow gcMultiRow1 = new GcMultiRow();
        public StickyCellDemo()
        {
            Text = "StickyCell Demo";
            Size = new Size(800, 400);
            StartPosition = FormStartPosition.CenterScreen;
            gcMultiRow1.Dock = DockStyle.Fill;

            Controls.Add(gcMultiRow1);
            Load += StickyCellDemoLoad;
        }

        private void StickyCellDemoLoad(object sender, EventArgs e)
        {
            this.gcMultiRow1.Template = this.CreateTemplate();
            this.gcMultiRow1.RowCount = 10;
        }

        private Template CreateTemplate()
        {
            Template template = new Template();
            ColumnHeaderSection columnHeaderSection1;
            ColumnHeaderCell columnHeaderCell1;
            RowHeaderCell rowHeaderCell1;
            ColumnHeaderCell columnHeaderCell2;
            CornerHeaderCell cornerHeaderCell1;
            ColumnHeaderCell columnHeaderCell3;
            TextBoxCell textBoxCell1;
            TextBoxCell textBoxCell2;
            TextBoxCell textBoxCell3;
            TextBoxCell textBoxCell5;
            TextBoxCell textBoxCell6;
            StickyCell stickyCell1;

            GrapeCity.Win.MultiRow.HeaderDropDownList headerDropDownList1 = new GrapeCity.Win.MultiRow.HeaderDropDownList();
            GrapeCity.Win.MultiRow.DropDownSortItem dropDownSortItem1 = new GrapeCity.Win.MultiRow.DropDownSortItem();
            GrapeCity.Win.MultiRow.DropDownSortItem dropDownSortItem2 = new GrapeCity.Win.MultiRow.DropDownSortItem();
            GrapeCity.Win.MultiRow.DropDownSeparatorItem dropDownSeparatorItem1 = new GrapeCity.Win.MultiRow.DropDownSeparatorItem();
            GrapeCity.Win.MultiRow.DropDownShowAllFilterItem dropDownShowAllFilterItem1 = new GrapeCity.Win.MultiRow.DropDownShowAllFilterItem();
            GrapeCity.Win.MultiRow.DropDownBlanksFilterItem dropDownBlanksFilterItem1 = new GrapeCity.Win.MultiRow.DropDownBlanksFilterItem();
            GrapeCity.Win.MultiRow.DropDownNonBlanksFilterItem dropDownNonBlanksFilterItem1 = new GrapeCity.Win.MultiRow.DropDownNonBlanksFilterItem();
            GrapeCity.Win.MultiRow.DropDownAutoFilterItem dropDownAutoFilterItem1 = new GrapeCity.Win.MultiRow.DropDownAutoFilterItem();
            columnHeaderSection1 = new GrapeCity.Win.MultiRow.ColumnHeaderSection();
            columnHeaderCell1 = new GrapeCity.Win.MultiRow.ColumnHeaderCell();
            columnHeaderCell2 = new GrapeCity.Win.MultiRow.ColumnHeaderCell();
            cornerHeaderCell1 = new GrapeCity.Win.MultiRow.CornerHeaderCell();
            columnHeaderCell3 = new GrapeCity.Win.MultiRow.ColumnHeaderCell();
            rowHeaderCell1 = new GrapeCity.Win.MultiRow.RowHeaderCell();
            textBoxCell1 = new GrapeCity.Win.MultiRow.TextBoxCell();
            textBoxCell2 = new GrapeCity.Win.MultiRow.TextBoxCell();
            textBoxCell3 = new GrapeCity.Win.MultiRow.TextBoxCell();
            textBoxCell5 = new GrapeCity.Win.MultiRow.TextBoxCell();
            textBoxCell6 = new GrapeCity.Win.MultiRow.TextBoxCell();
            stickyCell1 = new GrapeCity.Win.MultiRow.StickyCell();
            // 
            // Row
            // 
            template.Row.Cells.Add(rowHeaderCell1);
            template.Row.Cells.Add(textBoxCell1);
            template.Row.Cells.Add(textBoxCell2);
            template.Row.Cells.Add(textBoxCell3);
            template.Row.Cells.Add(textBoxCell5);
            template.Row.Cells.Add(textBoxCell6);
            template.Row.Cells.Add(stickyCell1);
            template.Row.Height = 42;
            template.Row.Width = 276;
            // 
            // columnHeaderSection1
            // 
            columnHeaderSection1.Cells.Add(columnHeaderCell1);
            columnHeaderSection1.Cells.Add(columnHeaderCell2);
            columnHeaderSection1.Cells.Add(cornerHeaderCell1);
            columnHeaderSection1.Cells.Add(columnHeaderCell3);
            columnHeaderSection1.Height = 20;
            columnHeaderSection1.Name = "columnHeaderSection1";
            columnHeaderSection1.Width = 276;
            // 
            // columnHeaderCell1
            // 
            dropDownSortItem2.SortOrder = System.Windows.Forms.SortOrder.Descending;
            headerDropDownList1.Items.Add(dropDownSortItem1);
            headerDropDownList1.Items.Add(dropDownSortItem2);
            headerDropDownList1.Items.Add(dropDownSeparatorItem1);
            headerDropDownList1.Items.Add(dropDownShowAllFilterItem1);
            headerDropDownList1.Items.Add(dropDownBlanksFilterItem1);
            headerDropDownList1.Items.Add(dropDownNonBlanksFilterItem1);
            headerDropDownList1.Items.Add(dropDownAutoFilterItem1);
            columnHeaderCell1.DropDownList = headerDropDownList1;
            columnHeaderCell1.FilterCellIndex = 0;
            columnHeaderCell1.FlatAppearance.BorderSize = 1;
            columnHeaderCell1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            columnHeaderCell1.HideDropDownButtonVisualEffect = true;
            columnHeaderCell1.Location = new System.Drawing.Point(36, 0);
            columnHeaderCell1.Name = "columnHeaderCell1";
            columnHeaderCell1.ShowDropDownButtonImages = true;
            columnHeaderCell1.TabIndex = 0;
            // 
            // columnHeaderCell2
            // 
            columnHeaderCell2.FlatAppearance.BorderSize = 1;
            columnHeaderCell2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            columnHeaderCell2.HoverDirection = GrapeCity.Win.MultiRow.HoverDirection.None;
            columnHeaderCell2.Location = new System.Drawing.Point(196, 0);
            columnHeaderCell2.Name = "columnHeaderCell2";
            columnHeaderCell2.ResizeMode = GrapeCity.Win.MultiRow.ResizeMode.Both;
            columnHeaderCell2.TabIndex = 5;
            // 
            // cornerHeaderCell1
            // 
            cornerHeaderCell1.Location = new System.Drawing.Point(0, 0);
            cornerHeaderCell1.Name = "cornerHeaderCell1";
            cornerHeaderCell1.Size = new System.Drawing.Size(36, 20);
            cornerHeaderCell1.TabIndex = 6;
            // 
            // columnHeaderCell3
            // 
            columnHeaderCell3.FlatAppearance.BorderSize = 1;
            columnHeaderCell3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            columnHeaderCell3.HoverDirection = GrapeCity.Win.MultiRow.HoverDirection.None;
            columnHeaderCell3.Location = new System.Drawing.Point(116, 0);
            columnHeaderCell3.Name = "columnHeaderCell3";
            columnHeaderCell3.ResizeMode = GrapeCity.Win.MultiRow.ResizeMode.Both;
            columnHeaderCell3.TabIndex = 7;
            // 
            // rowHeaderCell1
            // 
            rowHeaderCell1.FlatAppearance.BorderSize = 1;
            rowHeaderCell1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            rowHeaderCell1.Location = new System.Drawing.Point(0, 0);
            rowHeaderCell1.Name = "rowHeaderCell1";
            rowHeaderCell1.Size = new System.Drawing.Size(36, 42);
            rowHeaderCell1.TabIndex = 4;
            rowHeaderCell1.ValueFormat = "0";
            // 
            // textBoxCell1
            // 
            textBoxCell1.Location = new System.Drawing.Point(36, 0);
            textBoxCell1.Name = "textBoxCell1";
            textBoxCell1.TabIndex = 5;
            // 
            // textBoxCell2
            // 
            textBoxCell2.Location = new System.Drawing.Point(116, 0);
            textBoxCell2.Name = "textBoxCell2";
            textBoxCell2.TabIndex = 6;
            // 
            // textBoxCell3
            // 
            textBoxCell3.Location = new System.Drawing.Point(196, 0);
            textBoxCell3.Name = "textBoxCell3";
            textBoxCell3.TabIndex = 7;
            // 
            // textBoxCell5
            // 
            textBoxCell5.Location = new System.Drawing.Point(116, 21);
            textBoxCell5.Name = "textBoxCell5";
            textBoxCell5.TabIndex = 9;
            // 
            // textBoxCell6
            // 
            textBoxCell6.Location = new System.Drawing.Point(196, 21);
            textBoxCell6.Name = "textBoxCell6";
            textBoxCell6.TabIndex = 10;
            // 
            // stickyCell1
            // 
            stickyCell1.CandidateColors = new System.Drawing.Color[] {
        System.Drawing.Color.Silver,
        System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(192))))),
        System.Drawing.Color.Maroon,
        System.Drawing.Color.Blue,
        System.Drawing.Color.Yellow};
            stickyCell1.Location = new System.Drawing.Point(36, 21);
            stickyCell1.MarkColor = System.Drawing.Color.Red;
            stickyCell1.Name = "stickyCell1";
            stickyCell1.TabIndex = 20;
            this.SetStickyCell(stickyCell1);
            // 
            // TopToBottom1
            // 
            template.ColumnHeaders.AddRange(new GrapeCity.Win.MultiRow.ColumnHeaderSection[] {
            columnHeaderSection1});
            template.Height = 62;
            template.Width = 276;

            return template;
        }

        private void SetStickyCell(StickyCell stickyCell)
        {
            stickyCell.CandidateColors = new Color[] {Color.Orange, Color.Purple,Color.Red,Color.Green,Color.Blue,Color.Yellow};
            stickyCell.MarkColor = Color.Orange;
            stickyCell.ReminderTimes = 5;
            stickyCell.MarkColorChangedByDays = 3;
            stickyCell.TargetDate = DateTime.Today.AddDays(10d);
            stickyCell.Popup =  typeof(CustomPopForm);
        }

        [STAThreadAttribute()]
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new StickyCellDemo());
        }
    }

    public class CustomPopForm : Form, IStickyWindowSupport
    {
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.DateTimePicker dateTimePicker1;
        private System.Windows.Forms.Button button3;
       
        private void InitializeComponent()
        {
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.label1 = new System.Windows.Forms.Label();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.button2 = new System.Windows.Forms.Button();
            this.button1 = new System.Windows.Forms.Button();
            this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
            this.button3 = new System.Windows.Forms.Button();
            this.tableLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // tableLayoutPanel1
            // 
            this.tableLayoutPanel1.ColumnCount = 3;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 147F));
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 154F));
            this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.textBox1, 1, 0);
            this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2);
            this.tableLayoutPanel1.Controls.Add(this.button2, 2, 3);
            this.tableLayoutPanel1.Controls.Add(this.button1, 1, 3);
            this.tableLayoutPanel1.Controls.Add(this.dateTimePicker1, 1, 2);
            this.tableLayoutPanel1.Controls.Add(this.button3, 1, 1);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 4;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(401, 138);
            this.tableLayoutPanel1.TabIndex = 0;
            // 
            // label1
            // 
            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(3, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(94, 30);
            this.label1.TabIndex = 0;
            this.label1.Text = "Event";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // textBox1
            // 
            this.tableLayoutPanel1.SetColumnSpan(this.textBox1, 2);
            this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.textBox1.Location = new System.Drawing.Point(105, 5);
            this.textBox1.Margin = new System.Windows.Forms.Padding(5);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(291, 20);
            this.textBox1.TabIndex = 1;
            // 
            // label2
            // 
            this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(3, 30);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(94, 30);
            this.label2.TabIndex = 2;
            this.label2.Text = "MarkColor";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // label3
            // 
            this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.Location = new System.Drawing.Point(3, 60);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(94, 30);
            this.label3.TabIndex = 4;
            this.label3.Text = "TargetDate";
            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // button2
            // 
            this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button2.Location = new System.Drawing.Point(262, 100);
            this.button2.Margin = new System.Windows.Forms.Padding(15, 10, 15, 10);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(124, 30);
            this.button2.TabIndex = 7;
            this.button2.Text = "Cancel";
            this.button2.UseVisualStyleBackColor = true;
            // 
            // button1
            // 
            this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.button1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.button1.Location = new System.Drawing.Point(115, 100);
            this.button1.Margin = new System.Windows.Forms.Padding(15, 10, 15, 10);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(117, 30);
            this.button1.TabIndex = 6;
            this.button1.Text = "Ok";
            this.button1.UseVisualStyleBackColor = true;
            // 
            // dateTimePicker1
            // 
            this.tableLayoutPanel1.SetColumnSpan(this.dateTimePicker1, 2);
            this.dateTimePicker1.Location = new System.Drawing.Point(103, 63);
            this.dateTimePicker1.Name = "dateTimePicker1";
            this.dateTimePicker1.Size = new System.Drawing.Size(293, 20);
            this.dateTimePicker1.TabIndex = 5;
            // 
            // button3
            // 
            this.button3.BackColor = System.Drawing.Color.Red;
            this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.button3.Location = new System.Drawing.Point(103, 33);
            this.button3.Name = "button3";
            this.button3.Size = new System.Drawing.Size(71, 23);
            this.button3.TabIndex = 3;
            this.button3.Text = "EditColor...";
            this.button3.UseVisualStyleBackColor = false;
            this.button3.Click += new System.EventHandler(this.EditColorClick);
            // 
            // Form1
            // 
            this.AcceptButton = this.button1;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.button2;
            this.ClientSize = new System.Drawing.Size(401, 138);
            this.Controls.Add(this.tableLayoutPanel1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.ResumeLayout(false);

        }

        private Color _selectedColor;
        public CustomPopForm()
        {
            InitializeComponent();
        }

        public Color MarkColor
        {
            get
            {
                return _selectedColor;
            }
            set
            {
                _selectedColor = value;
                this.button3.BackColor = value;
            }
        }

        public string Content
        {
            get
            {
                return this.textBox1.Text;
            }
            set
            {
                this.textBox1.Text = value;
            }
        }

        public DateTime TargetDate
        {
            get
            {
                return this.dateTimePicker1.Value;
            }
            set
            {
                this.dateTimePicker1.Value = value;
            }
        }

        public Color[] CandidateColors
        {
            get;
            set;
        }

        private void EditColorClick(object sender, EventArgs e)
        {
            ColorDialog dialog = new ColorDialog();
            DialogResult result= dialog.ShowDialog();
            if(result == System.Windows.Forms.DialogResult.OK)
            {
                _selectedColor = dialog.Color;
            }

            this.button3.BackColor = _selectedColor;
        }

        public bool UseTargetDate
        {
            get;
            set;
        }
    }

}
Imports System.Collections.Generic
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms

Namespace GrapeCity.Win.MultiRow.SampleCode
    Public Class StickyCellDemo
        Inherits Form
        Private gcMultiRow1 As New GcMultiRow()
        Public Sub New()
            Text = "StickyCell Demo"
            Size = New Size(800, 400)
            StartPosition = FormStartPosition.CenterScreen
            gcMultiRow1.Dock = DockStyle.Fill

            Controls.Add(gcMultiRow1)
            AddHandler Load, AddressOf StickyCellDemoLoad
        End Sub

        Private Sub StickyCellDemoLoad(sender As Object, e As EventArgs)
            Me.gcMultiRow1.Template = Me.CreateTemplate()
            Me.gcMultiRow1.RowCount = 10
        End Sub

        Private Function CreateTemplate() As Template
            Dim template As New Template()
            Dim columnHeaderSection1 As ColumnHeaderSection
            Dim columnHeaderCell1 As ColumnHeaderCell
            Dim rowHeaderCell1 As RowHeaderCell
            Dim columnHeaderCell2 As ColumnHeaderCell
            Dim cornerHeaderCell1 As CornerHeaderCell
            Dim columnHeaderCell3 As ColumnHeaderCell
            Dim textBoxCell1 As TextBoxCell
            Dim textBoxCell2 As TextBoxCell
            Dim textBoxCell3 As TextBoxCell
            Dim textBoxCell5 As TextBoxCell
            Dim textBoxCell6 As TextBoxCell
            Dim stickyCell1 As StickyCell

            Dim headerDropDownList1 As New HeaderDropDownList()
            Dim dropDownSortItem1 As New DropDownSortItem()
            Dim dropDownSortItem2 As New DropDownSortItem()
            Dim dropDownSeparatorItem1 As New DropDownSeparatorItem()
            Dim dropDownShowAllFilterItem1 As New DropDownShowAllFilterItem()
            Dim dropDownBlanksFilterItem1 As New DropDownBlanksFilterItem()
            Dim dropDownNonBlanksFilterItem1 As New DropDownNonBlanksFilterItem()
            Dim dropDownAutoFilterItem1 As New DropDownAutoFilterItem()
            columnHeaderSection1 = New ColumnHeaderSection()
            columnHeaderCell1 = New ColumnHeaderCell()
            columnHeaderCell2 = New ColumnHeaderCell()
            cornerHeaderCell1 = New CornerHeaderCell()
            columnHeaderCell3 = New ColumnHeaderCell()
            rowHeaderCell1 = New RowHeaderCell()
            textBoxCell1 = New TextBoxCell()
            textBoxCell2 = New TextBoxCell()
            textBoxCell3 = New TextBoxCell()
            textBoxCell5 = New TextBoxCell()
            textBoxCell6 = New TextBoxCell()
            stickyCell1 = New StickyCell()
            ' 
            ' Row
            ' 
            template.Row.Cells.Add(rowHeaderCell1)
            template.Row.Cells.Add(textBoxCell1)
            template.Row.Cells.Add(textBoxCell2)
            template.Row.Cells.Add(textBoxCell3)
            template.Row.Cells.Add(textBoxCell5)
            template.Row.Cells.Add(textBoxCell6)
            template.Row.Cells.Add(stickyCell1)
            template.Row.Height = 42
            template.Row.Width = 276
            ' 
            ' columnHeaderSection1
            ' 
            columnHeaderSection1.Cells.Add(columnHeaderCell1)
            columnHeaderSection1.Cells.Add(columnHeaderCell2)
            columnHeaderSection1.Cells.Add(cornerHeaderCell1)
            columnHeaderSection1.Cells.Add(columnHeaderCell3)
            columnHeaderSection1.Height = 20
            columnHeaderSection1.Name = "columnHeaderSection1"
            columnHeaderSection1.Width = 276
            ' 
            ' columnHeaderCell1
            ' 
            dropDownSortItem2.SortOrder = System.Windows.Forms.SortOrder.Descending
            headerDropDownList1.Items.Add(dropDownSortItem1)
            headerDropDownList1.Items.Add(dropDownSortItem2)
            headerDropDownList1.Items.Add(dropDownSeparatorItem1)
            headerDropDownList1.Items.Add(dropDownShowAllFilterItem1)
            headerDropDownList1.Items.Add(dropDownBlanksFilterItem1)
            headerDropDownList1.Items.Add(dropDownNonBlanksFilterItem1)
            headerDropDownList1.Items.Add(dropDownAutoFilterItem1)
            columnHeaderCell1.DropDownList = headerDropDownList1
            columnHeaderCell1.FilterCellIndex = 0
            columnHeaderCell1.FlatAppearance.BorderSize = 1
            columnHeaderCell1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
            columnHeaderCell1.HideDropDownButtonVisualEffect = True
            columnHeaderCell1.Location = New System.Drawing.Point(36, 0)
            columnHeaderCell1.Name = "columnHeaderCell1"
            columnHeaderCell1.ShowDropDownButtonImages = True
            columnHeaderCell1.TabIndex = 0
            ' 
            ' columnHeaderCell2
            ' 
            columnHeaderCell2.FlatAppearance.BorderSize = 1
            columnHeaderCell2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
            columnHeaderCell2.HoverDirection = HoverDirection.None
            columnHeaderCell2.Location = New System.Drawing.Point(196, 0)
            columnHeaderCell2.Name = "columnHeaderCell2"
            columnHeaderCell2.ResizeMode = ResizeMode.Both
            columnHeaderCell2.TabIndex = 5
            ' 
            ' cornerHeaderCell1
            ' 
            cornerHeaderCell1.Location = New System.Drawing.Point(0, 0)
            cornerHeaderCell1.Name = "cornerHeaderCell1"
            cornerHeaderCell1.Size = New System.Drawing.Size(36, 20)
            cornerHeaderCell1.TabIndex = 6
            ' 
            ' columnHeaderCell3
            ' 
            columnHeaderCell3.FlatAppearance.BorderSize = 1
            columnHeaderCell3.FlatStyle = System.Windows.Forms.FlatStyle.Flat
            columnHeaderCell3.HoverDirection = HoverDirection.None
            columnHeaderCell3.Location = New System.Drawing.Point(116, 0)
            columnHeaderCell3.Name = "columnHeaderCell3"
            columnHeaderCell3.ResizeMode = ResizeMode.Both
            columnHeaderCell3.TabIndex = 7
            ' 
            ' rowHeaderCell1
            ' 
            rowHeaderCell1.FlatAppearance.BorderSize = 1
            rowHeaderCell1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
            rowHeaderCell1.Location = New System.Drawing.Point(0, 0)
            rowHeaderCell1.Name = "rowHeaderCell1"
            rowHeaderCell1.Size = New System.Drawing.Size(36, 42)
            rowHeaderCell1.TabIndex = 4
            rowHeaderCell1.ValueFormat = "0"
            ' 
            ' textBoxCell1
            ' 
            textBoxCell1.Location = New System.Drawing.Point(36, 0)
            textBoxCell1.Name = "textBoxCell1"
            textBoxCell1.TabIndex = 5
            ' 
            ' textBoxCell2
            ' 
            textBoxCell2.Location = New System.Drawing.Point(116, 0)
            textBoxCell2.Name = "textBoxCell2"
            textBoxCell2.TabIndex = 6
            ' 
            ' textBoxCell3
            ' 
            textBoxCell3.Location = New System.Drawing.Point(196, 0)
            textBoxCell3.Name = "textBoxCell3"
            textBoxCell3.TabIndex = 7
            ' 
            ' textBoxCell5
            ' 
            textBoxCell5.Location = New System.Drawing.Point(116, 21)
            textBoxCell5.Name = "textBoxCell5"
            textBoxCell5.TabIndex = 9
            ' 
            ' textBoxCell6
            ' 
            textBoxCell6.Location = New System.Drawing.Point(196, 21)
            textBoxCell6.Name = "textBoxCell6"
            textBoxCell6.TabIndex = 10
            ' 
            ' stickyCell1
            ' 
            stickyCell1.CandidateColors = New System.Drawing.Color() {System.Drawing.Color.Silver, System.Drawing.Color.FromArgb(CInt(CByte(192)), CInt(CByte(0)), CInt(CByte(192))), System.Drawing.Color.Maroon, System.Drawing.Color.Blue, System.Drawing.Color.Yellow}
            stickyCell1.Location = New System.Drawing.Point(36, 21)
            stickyCell1.MarkColor = System.Drawing.Color.Red
            stickyCell1.Name = "stickyCell1"
            stickyCell1.TabIndex = 20
            Me.SetStickyCell(stickyCell1)
            ' 
            ' TopToBottom1
            ' 
            template.ColumnHeaders.AddRange(New ColumnHeaderSection() {columnHeaderSection1})
            template.Height = 62
            template.Width = 276

            Return template
        End Function

        Private Sub SetStickyCell(stickyCell As StickyCell)
            stickyCell.CandidateColors = New Color() {Color.Orange, Color.Purple, Color.Red, Color.Green, Color.Blue, Color.Yellow}
            stickyCell.MarkColor = Color.Orange
            stickyCell.ReminderTimes = 5
            stickyCell.MarkColorChangedByDays = 3
            stickyCell.TargetDate = DateTime.Today.AddDays(10.0)
            stickyCell.Popup = GetType(CustomPopForm)
        End Sub

        <STAThreadAttribute> _
        Public Shared Sub Main()
            Application.EnableVisualStyles()
            Application.Run(New StickyCellDemo())
        End Sub
    End Class

    Public Class CustomPopForm
        Inherits Form
        Implements IStickyWindowSupport
        Private tableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
        Private label1 As System.Windows.Forms.Label
        Private textBox1 As System.Windows.Forms.TextBox
        Private label2 As System.Windows.Forms.Label
        Private label3 As System.Windows.Forms.Label
        Private button2 As System.Windows.Forms.Button
        Private button1 As System.Windows.Forms.Button
        Private dateTimePicker1 As System.Windows.Forms.DateTimePicker
        Private button3 As System.Windows.Forms.Button

        Private Sub InitializeComponent()
            Me.tableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
            Me.label1 = New System.Windows.Forms.Label()
            Me.textBox1 = New System.Windows.Forms.TextBox()
            Me.label2 = New System.Windows.Forms.Label()
            Me.label3 = New System.Windows.Forms.Label()
            Me.button2 = New System.Windows.Forms.Button()
            Me.button1 = New System.Windows.Forms.Button()
            Me.dateTimePicker1 = New System.Windows.Forms.DateTimePicker()
            Me.button3 = New System.Windows.Forms.Button()
            Me.tableLayoutPanel1.SuspendLayout()
            Me.SuspendLayout()
            ' 
            ' tableLayoutPanel1
            ' 
            Me.tableLayoutPanel1.ColumnCount = 3
            Me.tableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100.0F))
            Me.tableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 147.0F))
            Me.tableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 154.0F))
            Me.tableLayoutPanel1.Controls.Add(Me.label1, 0, 0)
            Me.tableLayoutPanel1.Controls.Add(Me.textBox1, 1, 0)
            Me.tableLayoutPanel1.Controls.Add(Me.label2, 0, 1)
            Me.tableLayoutPanel1.Controls.Add(Me.label3, 0, 2)
            Me.tableLayoutPanel1.Controls.Add(Me.button2, 2, 3)
            Me.tableLayoutPanel1.Controls.Add(Me.button1, 1, 3)
            Me.tableLayoutPanel1.Controls.Add(Me.dateTimePicker1, 1, 2)
            Me.tableLayoutPanel1.Controls.Add(Me.button3, 1, 1)
            Me.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.tableLayoutPanel1.Location = New System.Drawing.Point(0, 0)
            Me.tableLayoutPanel1.Name = "tableLayoutPanel1"
            Me.tableLayoutPanel1.RowCount = 4
            Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0F))
            Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0F))
            Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0F))
            Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50.0F))
            Me.tableLayoutPanel1.Size = New System.Drawing.Size(401, 138)
            Me.tableLayoutPanel1.TabIndex = 0
            ' 
            ' label1
            ' 
            Me.label1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CByte(0))
            Me.label1.Location = New System.Drawing.Point(3, 0)
            Me.label1.Name = "label1"
            Me.label1.Size = New System.Drawing.Size(94, 30)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Event"
            Me.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            ' 
            ' textBox1
            ' 
            Me.tableLayoutPanel1.SetColumnSpan(Me.textBox1, 2)
            Me.textBox1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.textBox1.Location = New System.Drawing.Point(105, 5)
            Me.textBox1.Margin = New System.Windows.Forms.Padding(5)
            Me.textBox1.Name = "textBox1"
            Me.textBox1.Size = New System.Drawing.Size(291, 20)
            Me.textBox1.TabIndex = 1
            ' 
            ' label2
            ' 
            Me.label2.Dock = System.Windows.Forms.DockStyle.Fill
            Me.label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CByte(0))
            Me.label2.Location = New System.Drawing.Point(3, 30)
            Me.label2.Name = "label2"
            Me.label2.Size = New System.Drawing.Size(94, 30)
            Me.label2.TabIndex = 2
            Me.label2.Text = "MarkColor"
            Me.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            ' 
            ' label3
            ' 
            Me.label3.Dock = System.Windows.Forms.DockStyle.Fill
            Me.label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CByte(0))
            Me.label3.Location = New System.Drawing.Point(3, 60)
            Me.label3.Name = "label3"
            Me.label3.Size = New System.Drawing.Size(94, 30)
            Me.label3.TabIndex = 4
            Me.label3.Text = "TargetDate"
            Me.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
            ' 
            ' button2
            ' 
            Me.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel
            Me.button2.Dock = System.Windows.Forms.DockStyle.Fill
            Me.button2.Location = New System.Drawing.Point(262, 100)
            Me.button2.Margin = New System.Windows.Forms.Padding(15, 10, 15, 10)
            Me.button2.Name = "button2"
            Me.button2.Size = New System.Drawing.Size(124, 30)
            Me.button2.TabIndex = 7
            Me.button2.Text = "Cancel"
            Me.button2.UseVisualStyleBackColor = True
            ' 
            ' button1
            ' 
            Me.button1.DialogResult = System.Windows.Forms.DialogResult.OK
            Me.button1.Dock = System.Windows.Forms.DockStyle.Fill
            Me.button1.Location = New System.Drawing.Point(115, 100)
            Me.button1.Margin = New System.Windows.Forms.Padding(15, 10, 15, 10)
            Me.button1.Name = "button1"
            Me.button1.Size = New System.Drawing.Size(117, 30)
            Me.button1.TabIndex = 6
            Me.button1.Text = "Ok"
            Me.button1.UseVisualStyleBackColor = True
            ' 
            ' dateTimePicker1
            ' 
            Me.tableLayoutPanel1.SetColumnSpan(Me.dateTimePicker1, 2)
            Me.dateTimePicker1.Location = New System.Drawing.Point(103, 63)
            Me.dateTimePicker1.Name = "dateTimePicker1"
            Me.dateTimePicker1.Size = New System.Drawing.Size(293, 20)
            Me.dateTimePicker1.TabIndex = 5
            ' 
            ' button3
            ' 
            Me.button3.BackColor = System.Drawing.Color.Red
            Me.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat
            Me.button3.Location = New System.Drawing.Point(103, 33)
            Me.button3.Name = "button3"
            Me.button3.Size = New System.Drawing.Size(71, 23)
            Me.button3.TabIndex = 3
            Me.button3.Text = "EditColor..."
            Me.button3.UseVisualStyleBackColor = False
            AddHandler Me.button3.Click, New System.EventHandler(AddressOf Me.EditColorClick)
            ' 
            ' Form1
            ' 
            Me.AcceptButton = Me.button1
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0F, 13.0F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.CancelButton = Me.button2
            Me.ClientSize = New System.Drawing.Size(401, 138)
            Me.Controls.Add(Me.tableLayoutPanel1)
            Me.Name = "Form1"
            Me.Text = "Form1"
            Me.tableLayoutPanel1.ResumeLayout(False)
            Me.tableLayoutPanel1.PerformLayout()
            Me.ResumeLayout(False)

        End Sub

        Private _selectedColor As Color
        Public Sub New()
            InitializeComponent()
        End Sub

        Public Property MarkColor As Color Implements IStickyWindowSupport.MarkColor
            Get
                Return _selectedColor
            End Get
            Set(value As Color)
                _selectedColor = value
                Me.button3.BackColor = value
            End Set
        End Property

        Public Property Content As String Implements IStickyWindowSupport.Content
            Get
                Return Me.textBox1.Text
            End Get
            Set(value As String)
                Me.textBox1.Text = value
            End Set
        End Property

        Public Property TargetDate As DateTime Implements IStickyWindowSupport.TargetDate
            Get
                Return Me.dateTimePicker1.Value
            End Get
            Set(value As DateTime)
                Me.dateTimePicker1.Value = value
            End Set
        End Property

        Public Property CandidateColors As Color() Implements IStickyWindowSupport.CandidateColors
            Get
                Return m_CandidateColors
            End Get
            Set(value As Color())
                m_CandidateColors = value
            End Set
        End Property
        Private m_CandidateColors As Color()

        Private Sub EditColorClick(sender As Object, e As EventArgs)
            Dim dialog As New ColorDialog()
            Dim result As DialogResult = dialog.ShowDialog()
            If result = System.Windows.Forms.DialogResult.OK Then
                _selectedColor = dialog.Color
            End If

            Me.button3.BackColor = _selectedColor
        End Sub

        Public Property UseTargetDate As Boolean Implements IStickyWindowSupport.UseTargetDate
            Get
                Return m_UseTargetDate
            End Get
            Set(value As Boolean)
                m_UseTargetDate = value
            End Set
        End Property
        Private m_UseTargetDate As Boolean
    End Class

End Namespace
継承階層

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         GrapeCity.Win.MultiRow.Cell
            GrapeCity.Win.MultiRow.StickyCell

参照

StickyCell メンバ
GrapeCity.Win.MultiRow 名前空間
IStickyWindowSupport インターフェース

 

 


© 2008-2015 GrapeCity inc. All rights reserved.