DataGridColumnStyle.GetMinimumHeight 方法
在派生类中被重写时,将获取一行的最小高度。
**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)
语法
声明
Protected Friend MustOverride Function GetMinimumHeight As Integer
用法
Dim returnValue As Integer
returnValue = Me.GetMinimumHeight
protected internal abstract int GetMinimumHeight ()
protected public:
virtual int GetMinimumHeight () abstract
protected abstract int GetMinimumHeight ()
protected internal abstract function GetMinimumHeight () : int
返回值
行的最小高度。
示例
下面的代码示例获取列的最小高度。
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
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 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 extends Form
{
protected DataGrid dataGrid1;
private void GetHeight()
{
MyGridColumn myGridColumn =
(MyGridColumn)(dataGrid1.get_TableStyles().
get_Item(1).get_GridColumnStyles().get_Item(0));
Console.WriteLine(myGridColumn.GetMinHeight());
} //GetHeight
}//Form1
public class MyGridColumn extends DataGridBoolColumn
{
public int GetMinHeight()
{
return this.GetMinimumHeight();
} //GetMinHeight
} //MyGridColumn
平台
Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
版本信息
.NET Framework
受以下版本支持:2.0、1.1、1.0
请参见
参考
DataGridColumnStyle 类
DataGridColumnStyle 成员
System.Windows.Forms 命名空间
GetPreferredHeight
GetPreferredSize
GetPreferredHeight
GetPreferredSize