using System;
using System.Windows.Forms;
using System.Drawing;
using GrapeCity.Win.CalendarGrid.InputMan;
using GrapeCity.Win.CalendarGrid;
namespace CalendarGridSampleCode
{
class GcComboBoxCellDemo : Form
{
private GcCalendarGrid gcCalendarGrid1 = new GcCalendarGrid();
private Label label = new Label();
public GcComboBoxCellDemo()
{
this.Text = "GcComboBoxCell 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 select one item from the DropDownList; hit the F4 to show the DropDownList.";
this.Controls.Add(label);
this.Load += Form1_Load;
this.StartPosition = FormStartPosition.CenterScreen;
}
private void Form1_Load(object sender, EventArgs e)
{
CalendarGcComboBoxCellType gcComboBoxCell1 = new CalendarGcComboBoxCellType();
gcComboBoxCell1.DropDownStyle = CalendarGridComboBoxStyle.DropDown;
gcComboBoxCell1.Items.AddRange(new string[] { "One", "Two", "Three" });
CalendarTemplate template1 = CalendarTemplate.CreateDefaultTemplate();
template1.Content[1, 0].CellType = gcComboBoxCell1;
template1.Content[2, 0].CellType = gcComboBoxCell1.Clone();
gcCalendarGrid1.Template = template1;
}
[STAThreadAttribute()]
public static void Main()
{
Application.EnableVisualStyles();
Application.Run(new GcComboBoxCellDemo());
}
}
}
Imports System.Windows.Forms
Imports System.Drawing
Imports GrapeCity.Win.CalendarGrid.InputMan
Imports GrapeCity.Win.CalendarGrid
Namespace CalendarGridSampleCode
Class GcComboBoxCellDemo
Inherits Form
Private gcCalendarGrid1 As New GcCalendarGrid()
Private label As New Label()
Public Sub New()
Me.Text = "GcComboBoxCell 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 select one item from the DropDownList; hit the F4 to show the DropDownList."
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)
Dim gcComboBoxCell1 As New CalendarGcComboBoxCellType()
gcComboBoxCell1.DropDownStyle = CalendarGridComboBoxStyle.DropDown
gcComboBoxCell1.Items.AddRange(New String() {"One", "Two", "Three"})
Dim template1 As CalendarTemplate = CalendarTemplate.CreateDefaultTemplate()
template1.Content(1, 0).CellType = gcComboBoxCell1
template1.Content(2, 0).CellType = gcComboBoxCell1.Clone()
gcCalendarGrid1.Template = template1
End Sub
<STAThreadAttribute> _
Public Shared Sub Main()
Application.EnableVisualStyles()
Application.Run(New GcComboBoxCellDemo())
End Sub
End Class
End Namespace