DataGridViewComboBoxCell.DisplayStyle 屬性

定義

取得或設定值,這個值可判斷當此下拉式方塊不在編輯模式中時,要如何顯示它。

public:
 property System::Windows::Forms::DataGridViewComboBoxDisplayStyle DisplayStyle { System::Windows::Forms::DataGridViewComboBoxDisplayStyle get(); void set(System::Windows::Forms::DataGridViewComboBoxDisplayStyle value); };
public System.Windows.Forms.DataGridViewComboBoxDisplayStyle DisplayStyle { get; set; }
member this.DisplayStyle : System.Windows.Forms.DataGridViewComboBoxDisplayStyle with get, set
Public Property DisplayStyle As DataGridViewComboBoxDisplayStyle

屬性值

DataGridViewComboBoxDisplayStyle

其中一個 DataGridViewComboBoxDisplayStyle 值。 預設為 DropDownButton

例外狀況

設定這個屬性時所指定的值不是有效的 DataGridViewComboBoxDisplayStyle 值。

備註

屬性 DisplayStyle 會在儲存格不在編輯模式時影響儲存格的外觀,而不論其是否為唯讀。 當儲存格處於編輯模式時,它一律看起來像 ComboBox 控制項。

DisplayStyleForCurrentCellOnly如果屬性值為 true ,則 DisplayStyle 屬性只會在為目前儲存格時影響儲存格。

下拉式箭號的行為和外觀會以 FlatStyle 屬性工作表示。

若要在滑鼠指標位於儲存格上方時啟用儲存格醒目提示,您必須將 DisplayStyle 屬性 ComboBox 設定為 ,並將 FlatStyle 屬性值設定為 Popup

DisplayStyle設定擁有資料行的 屬性也會設定 DisplayStyle 資料行中每個儲存格的 屬性,並重新整理資料行顯示。 若要覆寫個別儲存格的指定值,請在設定資料行值之後設定儲存格值。

適用於

另請參閱