共用方式為


DataGridTextBoxColumn.TextBox 屬性

定義

取得裝載的 TextBox 控制項。

public:
 virtual property System::Windows::Forms::TextBox ^ TextBox { System::Windows::Forms::TextBox ^ get(); };
[System.ComponentModel.Browsable(false)]
public virtual System.Windows.Forms.TextBox TextBox { get; }
[<System.ComponentModel.Browsable(false)>]
member this.TextBox : System.Windows.Forms.TextBox
Public Overridable ReadOnly Property TextBox As TextBox

屬性值

資料行所裝載的 TextBox 控制項。

屬性

範例

下列範例會變更託管 TextBox 控制項的背景色彩。

Private Sub SetTextBoxBgColor()
   Dim myGridTextBox As DataGridTextBox
   Dim myColumnTextColumn As DataGridTextBoxColumn
   ' Assumes there is a DataGridTextBoxColumn 
   ' already created in  the DataGrid control.
   myColumnTextColumn = CType(DataGrid1.TableStyles("Customers"). _
   GridColumnStyles("FirstName"), DataGridTextBoxColumn)
   myGridTextBox = CType(myColumnTextColumn.TextBox, _
   DataGridTextBox)
   ' Change the background color.
   myGridTextBox.BackColor = System.Drawing.Color.Red
End Sub

適用於

另請參閱