DataGridViewBand.Visible 屬性

定義

取得或設定值,指出使用者是否能看見群組列。

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,否則為 false。 預設為 true

例外狀況

當設定這個屬性時的指定值為 false,而且群組列為新記錄的資料列。

範例

下列程式碼範例示範如何使用 Visible 屬性來隱藏資料列。 此程式碼範例是針對 類別提供的較大範例的 DataGridViewBand 一部分。

// 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

備註

這個屬性可用來隱藏多餘的資料行或資料列。

適用於

另請參閱