次の図は、buttonCell1にマージンとパディングを四辺それぞれ10ピクセルで定義した例です。青い線はマージン、赤い線はパディングを示します。buttonCell2とbuttonCell3は比較のためマージンとパディングを変更していません。
マージンは
CellStyle.Marginプロパティで設定します。マージンを設定すると、デザイナでスナップラインを使用してセルを配置する際にセル同士の間隔を簡単に調整できます。
スナップラインが無効の場合、および実行時にはマージンは使用されません。
パディングは
CellStyle.Paddingプロパティで設定します。パディングの設定は、セルのコンテンツの表示に影響します。影響の範囲はセル型の実装に依存します。セルの罫線や背景色はパディングの影響を受けません。
Imports GrapeCity.Win.MultiRow
Dim Template1 As Template = New Template()
Dim ButtonCell1 As ButtonCell = New ButtonCell()
ButtonCell1.Name = "ButtonCell1"
ButtonCell1.Style.Padding = New Padding(20)
ButtonCell1.Size = New Size(80, 60)
ButtonCell1.Location = New Point(10, 10)
Template1.Width = 100
Template1.Row.Cells.Add(ButtonCell1)
Template1.Row.Height = 80
GcMultiRow1.Template = Template1
GcMultiRow1.RowCount = 10
using GrapeCity.Win.MultiRow;
Template template1 = new Template();
ButtonCell buttonCell1 = new ButtonCell();
buttonCell1.Name = "buttonCell1";
buttonCell1.Style.Padding = new Padding(20);
buttonCell1.Size = new Size(80, 60);
buttonCell1.Location = new Point(10, 10);
template1.Width = 100;
template1.Row.Cells.Add(buttonCell1);
template1.Row.Height = 80;
gcMultiRow1.Template = template1;
gcMultiRow1.RowCount = 10;