セルノートを作成する
セルにセルノートを追加するには、CellNoteクラスを使用します。
GcMultiRow1.CurrentCell.Note = New GrapeCity.Win.MultiRow.CellNote()gcMultiRow1.CurrentCell.Note = new GrapeCity.Win.MultiRow.CellNote(); セルノートの編集を開始する
セルに追加されているセルノートの編集を開始するにはGcMultiRow.BeginEditCellNoteメソッドを使用します。
Dim pos As GrapeCity.Win.MultiRow.CellPosition = GcMultiRow1.CurrentCellPosition Dim cell As GrapeCity.Win.MultiRow.Cell = GcMultiRow1.CurrentCell If cell.Note IsNot Nothing Then GcMultiRow1.BeginEditCellNote(pos) End If
GrapeCity.Win.MultiRow.CellPosition pos = gcMultiRow1.CurrentCellPosition; GrapeCity.Win.MultiRow.Cell cell = gcMultiRow1.CurrentCell; if (cell.Note != null) { gcMultiRow1.BeginEditCellNote(pos); }
セルノートを削除する
セルに追加されているセルノートを削除するにはCell.NoteクラスにNull値を設定します。
Dim cell As GrapeCity.Win.MultiRow.Cell = GcMultiRow1.CurrentCell If cell.Note IsNot Nothing Then cell.Note = Nothing End If
GrapeCity.Win.MultiRow.Cell cell = gcMultiRow1.CurrentCell; if (cell.Note != null) { cell.Note = null; }
セルノートの表示モードを設定する
セルノートの表示モードはCellNote.DisplayModeプロパティを使用します。
Imports GrapeCity.Win.MultiRow Dim cell As GrapeCity.Win.MultiRow.Cell = GcMultiRow1.CurrentCell If Cell.Note IsNot Nothing Then If cell.Note.DisplayMode = CellNoteDisplayMode.AlwaysShown Then cell.Note.DisplayMode = CellNoteDisplayMode.HoverShown Else cell.Note.DisplayMode = CellNoteDisplayMode.AlwaysShown End If End If
using GrapeCity.Win.MultiRow; Cell cell = gcMultiRow1.CurrentCell; if (cell.Note != null) { if (cell.Note.DisplayMode == CellNoteDisplayMode.AlwaysShown) { cell.Note.DisplayMode = CellNoteDisplayMode.HoverShown; } else { cell.Note.DisplayMode = CellNoteDisplayMode.AlwaysShown; } }
セルノートのスタイルを設定する
セルノートのスタイルはCellNote.Styleプロパティを使用します。


![]() |
|
Imports GrapeCity.Win.MultiRow Dim cellNote As CellNote = New CellNote() cellNote.Style.BackColor = Color.Azure cellNote.Style.ForeColor = Color.Blue cellNote.Text = "セルノート" ' 罫線のスタイル cellNote.Style.LineColor = Color.Red cellNote.Style.LineStyle = CellNoteLineStyle.Thin cellNote.Style.LineWidth = 5 ' 三角マークの色 cellNote.Style.TriangleSymbolColor = Color.Blue ' 影の表示 cellNote.Style.ShowShadow = MultiRowTriState.True GcMultiRow1.CurrentCell.Note = cellNote
using GrapeCity.Win.MultiRow; CellNote cellNote = new CellNote(); cellNote.Style.BackColor = Color.Azure; cellNote.Style.ForeColor = Color.Blue; cellNote.Text = "セルノート"; // 罫線のスタイル cellNote.Style.LineColor = Color.Pink; cellNote.Style.LineStyle = CellNoteLineStyle.Thin; cellNote.Style.LineWidth = 5; // 三角マークの色 cellNote.Style.TriangleSymbolColor = Color.Blue; // 影の表示 cellNote.Style.ShowShadow = MultiRowTriState.True; gcMultiRow1.CurrentCell.Note = cellNote;
セルノートのスタイルの適用ルール
セルノートのStyleプロパティがnullでない場合、各プロパティに次の値が設定されている場合にはGcMultiRow.DefaultCellNoteStyleプロパティの設定値が適用されます。それ以外は、各プロパティに設定された値が適用されます。
GcMultiRow.DefaultCellNoteStyleプロパティの既定値は次の通りです。
| プロパティ | 設定値 |
|---|---|
| BackColor ForeColor PatternColor LineColor TriangleSymbolColor |
Color.Empty |
| Font BackgroundImage ContextMenuStrip |
Null |
| LineAdjustment TextEffect Multiline PatternStyle TextAdjustment TextAlign TextVertical BackgroundImageLayout BackgroundGradientEffect UseCompatibleTextRendering WordWrap LineStyle ShowShadow |
Inherit |
| Padding | (-1,-1,-1,-1) |
| TextAngle LineWidth |
float.NaN |
| BackgroundImageOpacity | double.NaN |
| TextIndent | -1 |
| プロパティ | 既定値 |
|---|---|
| BackColor | LightYellow |
| ForeColor | GcMultiRowコントロールのForeColorプロパティの設定値 |
| Font | GcMultiRowコントロールのFontプロパティの設定値 |
| BackgroundGradientEffect | Null |
| Direction | Center |
| BackgroundImage | Null |
| BackgroundImageLayout | Tile |
| BackgroundImageOpacity | 1 |
| LineAdjustment | None |
| Multiline | True |
| Padding | (0,0,0,0) |
| PatternColor | WindowText |
| PatternStyle | None |
| TextAdjustment | Near |
| TextAlign | TopLeft |
| TextAngle | 0 |
| TextEffect | Flat |
| TextIndent | 0 |
| TextVertical | False |
| UseCompatibleTextRendering | False |
| WordWrap | True |
| LineColor | Color.Black |
| LineStyle | Thin |
| LineWidth | 1 |
| ShowShadow | Ture |
| ContextMenuStrip | Null |
| TriangleSymbolColor | Color.Red |
セルノートを作成する
セルにセルノートを追加するには、Cell.Noteクラスを使用します。
- セルノートの編集コントールはリッチテキストフォーマットをサポートしていません。
- セルノートは実行時にだけ追加することができます。設計時にセルノートを追加した場合には例外が発生します。
- 1つのセルノートは1つのセルにだけ設定することができます。同じセルノートを複数のセルに設定した場合には例外が発生します。
- セルノートはコミットされていない新規行に追加することはできません。
