DataGridViewBand.Visible DataGridViewBand.Visible DataGridViewBand.Visible DataGridViewBand.Visible Property

定義

取得或設定值,指出使用者是否能看見群組列。Gets or sets a value indicating whether the band is visible to the user.

public:
 virtual property bool Visible { bool get(); void set(bool value); };
public virtual bool Visible { get; set; }
member this.Visible : bool with get, set
Public Overridable Property Visible As Boolean

屬性值

如果可以看見群組列,則為 true,否則為 falsetrue if the band is visible; otherwise, false. 預設為 trueThe default is true.

例外狀況

當設定這個屬性時的指定值為 false,而且群組列為新記錄的資料列。The specified value when setting this property is false and the band is the row for new records.

範例

下列程式碼範例示範如何使用Visible屬性來隱藏資料列。The following code example demonstrates how to use the Visible property to hide a row. 這個程式碼範例是針對DataGridViewBand類別提供之較大範例的一部分。This code example is part of a larger example provided for the DataGridViewBand class.

// Hide a band of cells.
void Button6_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   DataGridViewBand^ band = dataGridView->Rows[ 3 ];
   band->Visible = false;
}


// Hide a band of cells.
private void Button6_Click(object sender, System.EventArgs e)
{

    DataGridViewBand band = dataGridView.Rows[3];
    band.Visible = false;
}
' Hide a band of cells.
Private Sub Button6_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Button6.Click

    Dim band As DataGridViewBand = dataGridView.Rows(3)
    band.Visible = False
End Sub

備註

這個屬性可以用來隱藏多餘的資料行或資料列。This property can be used to hide extraneous columns or rows.

適用於

另請參閱