GrapeCity CalendarGrid for Windows Forms 2.0J
CalendarGcTextBoxCellType クラス
メンバ  使用例 

CalendarGcTextBoxCellType クラスを表します。
構文
Public Class CalendarGcTextBoxCellType 
   Inherits CalendarInputManCellBaseType
public class CalendarGcTextBoxCellType : CalendarInputManCellBaseType 
使用例
次のサンプルコードは、GcTextBoxCell の使用方法を示します。
using System;
using System.Windows.Forms;
using System.Drawing;
using GrapeCity.Win.CalendarGrid.InputMan;
using GrapeCity.Win.CalendarGrid;

namespace CalendarGridSampleCode
{
    class GcTextBoxCellDemo : Form
    {
        private GcCalendarGrid gcCalendarGrid1 = new GcCalendarGrid();
        private Label label = new Label();

        public GcTextBoxCellDemo()
        {
            this.Text = "GcTextBoxCell Demo";
            this.Size = new Size(350, 300);

            // Add GcCalendarGrid to form
            this.gcCalendarGrid1.Dock = DockStyle.Fill;
            this.Controls.Add(this.gcCalendarGrid1);

            this.label.Dock = DockStyle.Bottom;
            this.label.Height = 50;
            this.label.BackColor = SystemColors.Info;
            this.label.Text = "You can only input upper and lower case alphabet, as well as the symbols. Except '#', '@' and '*' chars; The DropDownButton will show when GcTextBoxCell is CurrentCell, and you can switch the DropDownList through hitting the F4 in edit mode.";
            this.Controls.Add(label);

            this.Load += Form1_Load;

            this.StartPosition = FormStartPosition.CenterScreen;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // Create an instance of a GcTextBox control.
            CalendarGcTextBoxCellType gcTextBoxCell1 = new CalendarGcTextBoxCellType();
            // Accept upper and lower case alphabet, as well as the symbols. Except '#', '@' and '*' chars.
            gcTextBoxCell1.Format = @"aA@^\#\@*";
            // The GcTextBox will try to convert the invalid char to valid char automatically.
            gcTextBoxCell1.AutoConvert = true;

            DropDownButton dropDownButton1 = new DropDownButton();
            dropDownButton1.Visible = CalendarCellButtonVisibility.ShowForCurrentCell;
            gcTextBoxCell1.SideButtons.Add(dropDownButton1);

            CalendarTemplate template1 = CalendarTemplate.CreateDefaultTemplate();
            template1.Content[1, 0].CellType = gcTextBoxCell1;
            template1.Content[2, 0].CellType = gcTextBoxCell1.Clone();
            gcCalendarGrid1.Template = template1;
        }

        [STAThreadAttribute()]
        public static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new GcTextBoxCellDemo());
        }
    }
}
Imports System.Windows.Forms
Imports System.Drawing
Imports GrapeCity.Win.CalendarGrid.InputMan
Imports GrapeCity.Win.CalendarGrid

Namespace CalendarGridSampleCode
    Class GcTextBoxCellDemo
        Inherits Form
        Private gcCalendarGrid1 As New GcCalendarGrid()
        Private label As New Label()

        Public Sub New()
            Me.Text = "GcTextBoxCell Demo"
            Me.Size = New Size(350, 300)

            ' Add GcCalendarGrid to form
            Me.gcCalendarGrid1.Dock = DockStyle.Fill
            Me.Controls.Add(Me.gcCalendarGrid1)

            Me.label.Dock = DockStyle.Bottom
            Me.label.Height = 50
            Me.label.BackColor = SystemColors.Info
            Me.label.Text = "You can only input upper and lower case alphabet, as well as the symbols. Except '#', '@' and '*' chars; The DropDownButton will show when GcTextBoxCell is CurrentCell, and you can switch the DropDownList through hitting the F4 in edit mode."
            Me.Controls.Add(label)

            AddHandler Me.Load, AddressOf Form1_Load

            Me.StartPosition = FormStartPosition.CenterScreen
        End Sub

        Private Sub Form1_Load(sender As Object, e As EventArgs)
            ' Create an instance of a GcTextBox control.
            Dim gcTextBoxCell1 As New CalendarGcTextBoxCellType()
            ' Accept upper and lower case alphabet, as well as the symbols. Except '#', '@' and '*' chars.
            gcTextBoxCell1.Format = "aA@^\#\@*"
            ' The GcTextBox will try to convert the invalid char to valid char automatically.
            gcTextBoxCell1.AutoConvert = True

            Dim dropDownButton1 As New DropDownButton()
            dropDownButton1.Visible = CalendarCellButtonVisibility.ShowForCurrentCell
            gcTextBoxCell1.SideButtons.Add(dropDownButton1)

            Dim template1 As CalendarTemplate = CalendarTemplate.CreateDefaultTemplate()
            template1.Content(1, 0).CellType = gcTextBoxCell1
            template1.Content(2, 0).CellType = gcTextBoxCell1.Clone()
            gcCalendarGrid1.Template = template1
        End Sub

        <STAThreadAttribute> _
        Public Shared Sub Main()
            Application.EnableVisualStyles()
            Application.Run(New GcTextBoxCellDemo())
        End Sub
    End Class
End Namespace
継承階層

System.Object
   GrapeCity.Win.CalendarGrid.CalendarCellType
      GrapeCity.Win.CalendarGrid.InputMan.CalendarInputManCellBaseType
         GrapeCity.Win.CalendarGrid.InputMan.CalendarGcTextBoxCellType

参照

CalendarGcTextBoxCellType メンバ
GrapeCity.Win.CalendarGrid.InputMan 名前空間

 

 


c 2008 GrapeCity inc. All rights reserved.