Control.Bottom 属性
获取控件下边缘与其容器的工作区上边缘之间的距离(以像素为单位)。
**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)
语法
声明
Public ReadOnly Property Bottom As Integer
用法
Dim instance As Control
Dim value As Integer
value = instance.Bottom
public int Bottom { get; }
public:
property int Bottom {
int get ();
}
/** @property */
public int get_Bottom ()
public function get Bottom () : int
属性值
Int32 表示控件下边缘与其容器的工作区上边缘之间的距离(以像素为单位)。
备注
该属性的值等于 Top 属性值与 Height 属性值之和。
Bottom 属性为只读属性。可以通过更改 Top 或 Height 属性的值,或调用 SetBounds、SetBoundsCore、UpdateBounds 或 SetClientSizeCore 方法,来操作该属性值。
示例
下面的代码示例使用 Bottom 属性来定义 TextBox 控件相对于容器工作区的下限。
' This example demonstrates how to use the KeyUp event with the Help class to display
' pop-up style help to the user of the application. When the user presses F1, the Help
' class displays a pop-up window, similar to a ToolTip, near the control. This example assumes
' that a TextBox control, named textBox1, has been added to the form and its KeyUp
' event has been contected to this event handler method.
Private Sub textBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles textBox1.KeyUp
' Determine whether the key entered is the F1 key. Display help if it is.
If e.KeyCode = Keys.F1 Then
' Display a pop-up help topic to assist the user.
Help.ShowPopup(textBox1, "Enter your first name", New Point(textBox1.Right, Me.textBox1.Bottom))
End If
End Sub 'textBox1_KeyUp
// This example demonstrates how to use the KeyUp event with the Help class to display
// pop-up style help to the user of the application. When the user presses F1, the Help
// class displays a pop-up window, similar to a ToolTip, near the control. This example assumes
// that a TextBox control, named textBox1, has been added to the form and its KeyUp
// event has been contected to this event handler method.
private void textBox1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
// Determine whether the key entered is the F1 key. Display help if it is.
if(e.KeyCode == Keys.F1)
{
// Display a pop-up help topic to assist the user.
Help.ShowPopup(textBox1, "Enter your first name", new Point(textBox1.Right, this.textBox1.Bottom));
}
}
// This example demonstrates how to use the KeyUp event with the Help class to display
// pop-up style help to the user of the application. When the user presses F1, the Help
// class displays a pop-up window, similar to a ToolTip, near the control. This example assumes
// that a TextBox control, named textBox1, has been added to the form and its KeyUp
// event has been connected to this event handler method.
private:
void textBox1_KeyUp( Object^ /*sender*/, System::Windows::Forms::KeyEventArgs^ e )
{
// Determine whether the key entered is the F1 key. Display help if it is.
if ( e->KeyCode == Keys::F1 )
{
// Display a pop-up help topic to assist the user.
Help::ShowPopup( textBox1, "Enter your first name", Point(textBox1->Right,this->textBox1->Bottom) );
}
}
// This example demonstrates how to use the KeyUp event with the Help
// class to display pop-up style help to the user of the application.
// When the user presses F1, the Help class displays a pop-up window,
// similar to a ToolTip, near the control. This example assumes that a
// TextBox control, named textBox1, has been added to the form and its
// KeyUp event has been contected to this event handler method.
private void textBox1_KeyUp(Object sender,
System.Windows.Forms.KeyEventArgs e)
{
// Determine whether the key entered is the F1 key.
// Display help if it is.
if (e.get_KeyCode().Equals(Keys.F1)) {
// Display a pop-up help topic to assist the user.
Help.ShowPopup(textBox1, "Enter your first name",
new Point(textBox1.get_Right(), this.textBox1.get_Bottom()));
}
} //textBox1_KeyUp
平台
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
.NET Compact Framework
受以下版本支持:2.0、1.0