DataGridViewCell.AdjustCellBorderStyle Yöntem

Tanım

Giriş hücresi kenarlık stilini belirtilen ölçütlere göre değiştirir.

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

Parametreler

dataGridViewAdvancedBorderStyleInput
DataGridViewAdvancedBorderStyle

DataGridViewAdvancedBorderStyle Değiştirileceği hücre kenarlık stilini temsil eden bir.

dataGridViewAdvancedBorderStylePlaceholder
DataGridViewAdvancedBorderStyle

DataGridViewAdvancedBorderStyle Hücre kenarlık stilinde ara değişiklikleri depolamak için kullanılan bir.

singleVerticalBorderAdded
Boolean

true hücreye dikey kenarlık eklemek için; aksi takdirde , false.

singleHorizontalBorderAdded
Boolean

true hücreye yatay kenarlık eklemek için; aksi takdirde , false.

isFirstDisplayedColumn
Boolean

true barındırma hücresi ilk görünür sütundaysa; aksi takdirde , false.

isFirstDisplayedRow
Boolean

true barındırma hücresi ilk görünür satırdaysa; aksi takdirde , false.

Döndürülenler

DataGridViewAdvancedBorderStyle

Değiştirilen DataGridViewAdvancedBorderStyle.

Örnekler

Aşağıdaki kod örneği, hücrelerin kenarlıklarını özelleştirmek için yönteminin nasıl geçersiz kılınduğunu AdjustCellBorderStyle gösterir. Bu kod örneği, sınıfı için DataGridViewAdvancedBorderStyle sağlanan daha büyük bir örneğin parçasıdır.

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

Açıklamalar

Denetim, DataGridView hücre kenarlıklarının AdjustCellBorderStyle görünümünü belirlemek için yöntemini dahili olarak çağırır. Denetim DataGridView genellikle parametresi için özelliğinin AdvancedCellBorderStyle dataGridViewAdvancedBorderStyleInput değerini kullanır.

Değer DataGridViewAdvancedCellBorderStyle.OutsetPartial , hücreler için giriş stili olarak desteklenmez.

Devralanlara Notlar

Hücre kenarlıklarının görünümünü özelleştirmek istiyorsanız bu yöntemi geçersiz kılın.

Şunlara uygulanır

Ayrıca bkz.