GrapeCity CalendarGrid for Windows Forms 2.0J > CalendarGridの使い方 > InputManCell > GcMask型セル > サンプルコード(CalendarGcMaskCellType) |
CalendarGcMaskCellTypeの値が未入力のとき、入力候補となる値を表示ができます。
Imports InputManCell = GrapeCity.Win.CalendarGrid.InputMan Dim today As DateTime = DateTime.Today Dim GcMaskCellType As New InputManCell.CalendarGcMaskCellType() GcMaskCellType.Fields.AddRange("郵便番号:\D{3}-\D{4}") ' 入力候補値の設定 GcMaskCellType.ShowRecommendedValue = True GcMaskCellType.RecommendedValue = "9813205" GcCalendarGrid1.Content(today).Rows(1).Cells(0).CellType = GcMaskCellType GcCalendarGrid1.Content(today).Rows(1).Cells(0).CellStyle.BackColor = Color.Azure GcCalendarGrid1.ScrollIntoView(today)
using InputManCell = GrapeCity.Win.CalendarGrid.InputMan; var today = DateTime.Today; var gcMaskCellType = new InputManCell.CalendarGcMaskCellType(); gcMaskCellType.Fields.AddRange("郵便番号:\\D{3}-\\D{4}"); // 入力候補値の設定 gcMaskCellType.ShowRecommendedValue = true; gcMaskCellType.RecommendedValue = "9813205"; gcCalendarGrid1.Content[today].Rows[1].Cells[0].CellType = gcMaskCellType; gcCalendarGrid1.Content[today].Rows[1].Cells[0].CellStyle.BackColor = Color.Azure; gcCalendarGrid1.ScrollIntoView(today);