GrapeCity CalendarGrid for Windows Forms 3.0J
改行を入力する

改行を入力する

ユーザーの操作でTextBox型セルに改行を入力するには、[Shift] + [Enter] をタイプします。

TextBox型セルで改行の入力を許可するには、CalendarTextBoxCellType.MultilineプロパティにTrueを設定します。

Imports GrapeCity.Win.CalendarGrid

Dim template As New CalendarTemplate()
template.Content.RowCount = 4
template.ColumnHeaderRowCount = 1
template.ColumnHeader.Rows(0).Cells(0).CellStyleName = "defaultStyle"
template.ColumnHeader.Rows(0).Cells(0).DateFormat = "{DayOfWeek}"
template.RowHeader.Rows(1).Cells(0).RowSpan = 3
template.RowHeader.Rows(1).Cells(0).Value = "メモ"
template.RowHeader.Columns(0).Width = 30
template.Content.CellStyleName = "defaultStyle"
template.Content.Rows(0).Cells(0).DateFormatType = CalendarDateFormatType.DotNet
template.Content.Rows(0).Cells(0).DateFormat = "%d"
template.Content.Rows(1).Cells(0).RowSpan = 3
template.Content.Rows(1).Cells(0).CellStyle.Alignment = CalendarGridContentAlignment.TopLeft
Dim textBoxCellType As New CalendarTextBoxCellType()
textBoxCellType.Multiline = True
textBoxCellType.WordWrap = True
textBoxCellType.ScrollBars = ScrollBars.Vertical
template.Content.Rows(1).Cells(0).CellType = textBoxCellType.Clone()

GcCalendarGrid1.Template = template
using GrapeCity.Win.CalendarGrid;

var template = new CalendarTemplate();
template.Content.RowCount = 4;
template.ColumnHeaderRowCount = 1;
template.ColumnHeader.Rows[0].Cells[0].CellStyleName = "defaultStyle";
template.ColumnHeader.Rows[0].Cells[0].DateFormat = "{DayOfWeek}";
template.RowHeader.Rows[1].Cells[0].RowSpan = 3;
template.RowHeader.Rows[1].Cells[0].Value = "メモ";
template.RowHeader.Columns[0].Width = 30;
template.Content.CellStyleName = "defaultStyle";
template.Content.Rows[0].Cells[0].DateFormatType = CalendarDateFormatType.DotNet;
template.Content.Rows[0].Cells[0].DateFormat = "%d";
template.Content.Rows[1].Cells[0].RowSpan = 3;
template.Content.Rows[1].Cells[0].CellStyle.Alignment = CalendarGridContentAlignment.TopLeft;
var textBoxCellType = new CalendarTextBoxCellType();
textBoxCellType.Multiline = true;
textBoxCellType.WordWrap = true;
textBoxCellType.ScrollBars = ScrollBars.Vertical;
template.Content.Rows[1].Cells[0].CellType = textBoxCellType.Clone();

gcCalendarGrid1.Template = template;

結果は次のようになります。

 


関連トピック

 

 


© 2008 GrapeCity inc. All rights reserved.