DataGridViewCell.AdjustCellBorderStyle メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した条件に従って、入力セルの罫線のスタイルを変更します。
public:
virtual System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ AdjustCellBorderStyle(System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ dataGridViewAdvancedBorderStyleInput, System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow);
public virtual System.Windows.Forms.DataGridViewAdvancedBorderStyle AdjustCellBorderStyle(System.Windows.Forms.DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput, System.Windows.Forms.DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow);
abstract member AdjustCellBorderStyle : System.Windows.Forms.DataGridViewAdvancedBorderStyle * System.Windows.Forms.DataGridViewAdvancedBorderStyle * bool * bool * bool * bool -> System.Windows.Forms.DataGridViewAdvancedBorderStyle
override this.AdjustCellBorderStyle : System.Windows.Forms.DataGridViewAdvancedBorderStyle * System.Windows.Forms.DataGridViewAdvancedBorderStyle * bool * bool * bool * bool -> System.Windows.Forms.DataGridViewAdvancedBorderStyle
Public Overridable Function AdjustCellBorderStyle (dataGridViewAdvancedBorderStyleInput As DataGridViewAdvancedBorderStyle, dataGridViewAdvancedBorderStylePlaceholder As DataGridViewAdvancedBorderStyle, singleVerticalBorderAdded As Boolean, singleHorizontalBorderAdded As Boolean, isFirstDisplayedColumn As Boolean, isFirstDisplayedRow As Boolean) As DataGridViewAdvancedBorderStyle
パラメーター
- dataGridViewAdvancedBorderStyleInput
- DataGridViewAdvancedBorderStyle
変更するセルの罫線スタイルを表す DataGridViewAdvancedBorderStyle 。
- dataGridViewAdvancedBorderStylePlaceholder
- DataGridViewAdvancedBorderStyle
セルの境界線スタイルに対する中間の変更を格納するために使用される DataGridViewAdvancedBorderStyle 。
- singleVerticalBorderAdded
- Boolean
true セルに垂直罫線を追加する場合。それ以外の場合は false。
- singleHorizontalBorderAdded
- Boolean
true セルに水平罫線を追加する場合。それ以外の場合は false。
- isFirstDisplayedColumn
- Boolean
true ホスティングセルが最初に表示される列にある場合。それ以外の場合は false。
- isFirstDisplayedRow
- Boolean
true ホスティングセルが最初に表示される行にある場合。それ以外の場合は false。
返品
変更された DataGridViewAdvancedBorderStyle。
例
次のコード例では、 AdjustCellBorderStyle メソッドをオーバーライドしてセルの境界線をカスタマイズする方法を示します。 このコード例は、 DataGridViewAdvancedBorderStyle クラスに提供されるより大きな例の一部です。
public override DataGridViewAdvancedBorderStyle AdjustCellBorderStyle(
DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput,
DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceHolder,
bool singleVerticalBorderAdded,
bool singleHorizontalBorderAdded,
bool firstVisibleColumn,
bool firstVisibleRow)
{
// Customize the top border of cells in the first row and the
// right border of cells in the first column. Use the input style
// for all other borders.
dataGridViewAdvancedBorderStylePlaceHolder.Left = firstVisibleColumn ?
DataGridViewAdvancedCellBorderStyle.OutsetDouble :
DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceHolder.Top = firstVisibleRow ?
DataGridViewAdvancedCellBorderStyle.InsetDouble :
DataGridViewAdvancedCellBorderStyle.None;
dataGridViewAdvancedBorderStylePlaceHolder.Right =
dataGridViewAdvancedBorderStyleInput.Right;
dataGridViewAdvancedBorderStylePlaceHolder.Bottom =
dataGridViewAdvancedBorderStyleInput.Bottom;
return dataGridViewAdvancedBorderStylePlaceHolder;
}
Public Overrides Function AdjustCellBorderStyle( _
ByVal dataGridViewAdvancedBorderStyleInput As DataGridViewAdvancedBorderStyle, _
ByVal dataGridViewAdvancedBorderStylePlaceHolder As DataGridViewAdvancedBorderStyle, _
ByVal singleVerticalBorderAdded As Boolean, _
ByVal singleHorizontalBorderAdded As Boolean, _
ByVal firstVisibleColumn As Boolean, _
ByVal firstVisibleRow As Boolean) As DataGridViewAdvancedBorderStyle
' Customize the top border of cells in the first row and the
' right border of cells in the first column. Use the input style
' for all other borders.
If firstVisibleColumn Then
dataGridViewAdvancedBorderStylePlaceHolder.Left = _
DataGridViewAdvancedCellBorderStyle.OutsetDouble
Else
dataGridViewAdvancedBorderStylePlaceHolder.Left = _
DataGridViewAdvancedCellBorderStyle.None
End If
If firstVisibleRow Then
dataGridViewAdvancedBorderStylePlaceHolder.Top = _
DataGridViewAdvancedCellBorderStyle.InsetDouble
Else
dataGridViewAdvancedBorderStylePlaceHolder.Top = _
DataGridViewAdvancedCellBorderStyle.None
End If
With dataGridViewAdvancedBorderStylePlaceHolder
.Right = dataGridViewAdvancedBorderStyleInput.Right
.Bottom = dataGridViewAdvancedBorderStyleInput.Bottom
End With
Return dataGridViewAdvancedBorderStylePlaceHolder
End Function
End Class
注釈
DataGridView コントロールは、内部的に AdjustCellBorderStyle メソッドを呼び出して、セルの境界線の外観を決定します。
DataGridView コントロールは、通常、AdvancedCellBorderStyle パラメーターのdataGridViewAdvancedBorderStyleInput プロパティの値を使用します。
DataGridViewAdvancedCellBorderStyle.OutsetPartial値は、セルの入力スタイルとしてサポートされていません。
注意 (継承者)
セルの罫線の外観をカスタマイズする場合は、このメソッドをオーバーライドします。