DataGridColumnStyle.GetMinimumHeight 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在衍生類別中覆寫時,取得資料列的最小高度。
protected public:
abstract int GetMinimumHeight();
protected internal abstract int GetMinimumHeight ();
abstract member GetMinimumHeight : unit -> int
Protected Friend MustOverride Function GetMinimumHeight () As Integer
傳回
資料列的最小高度。
範例
下列程式碼範例會取得資料行的最小高度。
public ref class MyGridColumn: public DataGridBoolColumn
{
public:
int GetMinHeight()
{
return this->GetMinimumHeight();
}
};
public ref class Form1: public Form
{
protected:
DataGrid^ dataGrid1;
private:
void GetHeight()
{
MyGridColumn^ myGridColumn = dynamic_cast<MyGridColumn^>(dataGrid1->TableStyles[ 1 ]->GridColumnStyles[ 0 ]);
Console::WriteLine( myGridColumn->GetMinHeight() );
}
};
public class Form1: Form
{
protected DataGrid dataGrid1;
private void GetHeight(){
MyGridColumn myGridColumn = (MyGridColumn)dataGrid1.TableStyles[1].GridColumnStyles[0];
Console.WriteLine(myGridColumn.GetMinHeight());
}
}
public class MyGridColumn:DataGridBoolColumn{
public int GetMinHeight(){
return this.GetMinimumHeight();
}
}
Public Class Form1
Inherits Form
Protected dataGrid1 As DataGrid
Private Sub GetHeight()
Dim myGridColumn As MyGridColumn = _
CType(dataGrid1.TableStyles(1).GridColumnStyles(0), _
MyGridColumn)
Console.WriteLine(myGridColumn.GetMinHeight())
End Sub
End Class
Public Class MyGridColumn
Inherits DataGridBoolColumn
Public Function GetMinHeight() As Integer
return me.GetMinimumHeight()
End Function
End Class