DataGridViewCell.PositionEditingControl 方法

定義

設定由 DataGridView 控制項中的儲存格裝載之編輯控制項的位置和大小。

public:
 virtual void PositionEditingControl(bool setLocation, bool setSize, System::Drawing::Rectangle cellBounds, System::Drawing::Rectangle cellClip, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow);
public virtual void PositionEditingControl (bool setLocation, bool setSize, System.Drawing.Rectangle cellBounds, System.Drawing.Rectangle cellClip, System.Windows.Forms.DataGridViewCellStyle cellStyle, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow);
abstract member PositionEditingControl : bool * bool * System.Drawing.Rectangle * System.Drawing.Rectangle * System.Windows.Forms.DataGridViewCellStyle * bool * bool * bool * bool -> unit
override this.PositionEditingControl : bool * bool * System.Drawing.Rectangle * System.Drawing.Rectangle * System.Windows.Forms.DataGridViewCellStyle * bool * bool * bool * bool -> unit
Public Overridable Sub PositionEditingControl (setLocation As Boolean, setSize As Boolean, cellBounds As Rectangle, cellClip As Rectangle, cellStyle As DataGridViewCellStyle, singleVerticalBorderAdded As Boolean, singleHorizontalBorderAdded As Boolean, isFirstDisplayedColumn As Boolean, isFirstDisplayedRow As Boolean)

參數

setLocation
Boolean

true 表示依其他引數所指定來放置控制項;false 則表示允許控制項本身自行放置。

setSize
Boolean

true 表示指定大小;false 則表示允許控制項本身自行調整大小。

cellBounds
Rectangle

Rectangle,定義儲存格範圍。

cellClip
Rectangle

用來繪製編輯控制項的區域。

cellStyle
DataGridViewCellStyle

DataGridViewCellStyle,代表正在編輯之儲存格的樣式。

singleVerticalBorderAdded
Boolean

true 表示將垂直框線加入儲存格中;否則為 false

singleHorizontalBorderAdded
Boolean

true 表示將水平框線加入儲存格中;否則為 false

isFirstDisplayedColumn
Boolean

如果裝載儲存格是在第一個可見的資料行中,則為 true;否則為 false

isFirstDisplayedRow
Boolean

如果裝載儲存格是在第一個可見的資料列中,則為 true;否則為 false

例外狀況

儲存格不包含於 DataGridView 控制項之中。

備註

衍生自 DataGridViewCell 類別的某些類別,例如 DataGridViewComboBoxCell ,在選取的儲存格中裝載控制項。 方法會將 PositionEditingControl 編輯控制項放在主儲存格內。 因為編輯控制項可能會佔用比單一儲存格更多的空間,所以在編輯第一個可見資料行或第一個可見資料列的儲存格時,可能需要以不同的方式放置它,使其不會繪製在 外部 DataGridView

適用於

另請參閱