FormBorderStyle FormBorderStyle FormBorderStyle FormBorderStyle Enum

定义

指定窗体的边框样式。Specifies the border styles for a form.

public enum class FormBorderStyle
[System.Runtime.InteropServices.ComVisible(true)]
public enum FormBorderStyle
type FormBorderStyle = 
Public Enum FormBorderStyle
继承
FormBorderStyleFormBorderStyleFormBorderStyleFormBorderStyle
属性

字段

Fixed3D Fixed3D Fixed3D Fixed3D 2

固定的三维边框。A fixed, three-dimensional border.

FixedDialog FixedDialog FixedDialog FixedDialog 3

粗、 固定的对话框样式边框。A thick, fixed dialog-style border.

FixedSingle FixedSingle FixedSingle FixedSingle 1

固定的单线边框。A fixed, single-line border.

FixedToolWindow FixedToolWindow FixedToolWindow FixedToolWindow 5

不可调整大小的工具窗口边框。A tool window border that is not resizable. 在任务栏中或在用户按 ALT + TAB 时出现的窗口中,不会显示工具窗口。A tool window does not appear in the taskbar or in the window that appears when the user presses ALT+TAB. 虽然窗体,用于指定FixedToolWindow通常不显示在任务栏中,您必须确保ShowInTaskbar属性设置为false,因为其默认值是trueAlthough forms that specify FixedToolWindow typically are not shown in the taskbar, you must also ensure that the ShowInTaskbar property is set to false, since its default value is true.

None None None None 0

无边框。No border.

Sizable Sizable Sizable Sizable 4

可调整大小的边框。A resizable border.

SizableToolWindow SizableToolWindow SizableToolWindow SizableToolWindow 6

可调整大小的工具窗口边框。A resizable tool window border. 在任务栏中或在用户按 ALT + TAB 时出现的窗口中,不会显示工具窗口。A tool window does not appear in the taskbar or in the window that appears when the user presses ALT+TAB.

示例

在此示例中,更改到窗体的边框样式Fixed3d并显示使用标签的边框的信息。In this example, you change the form border style to Fixed3d and display the border's information using a label. 此示例假定已创建Form名为Form1This example assumes that you have already created a Form named Form1.

public:
   void InitMyForm()
   {
      // Adds a label to the form.
      Label^ label1 = gcnew Label;
      label1->Location = System::Drawing::Point( 80, 80 );
      label1->Name = "label1";
      label1->Size = System::Drawing::Size( 132, 80 );
      label1->Text = "Start Position Information";
      this->Controls->Add( label1 );
      
      // Changes the border to Fixed3D.
      FormBorderStyle = ::FormBorderStyle::Fixed3D;
      
      // Displays the border information.
      label1->Text = String::Format( "The border is {0}", FormBorderStyle );
   }
public void InitMyForm()
{
	// Adds a label to the form.
	Label label1 = new Label();
	label1.Location = new System.Drawing.Point(80,80);
	label1.Name = "label1";
	label1.Size = new System.Drawing.Size(132,80);
	label1.Text = "Start Position Information";
	this.Controls.Add(label1);

	// Changes the border to Fixed3D.
	FormBorderStyle = FormBorderStyle.Fixed3D;

	// Displays the border information.
	label1.Text = "The border is " + FormBorderStyle;	
}
Public Sub InitMyForm()
   ' Adds a label to the form.
   Dim label1 As New Label()
   label1.Location = New System.Drawing.Point(80, 80)
   label1.Name = "label1"
   label1.Size = New System.Drawing.Size(132, 80)
   label1.Text = "Start Position Information"
   Me.Controls.Add(label1)
   
   ' Changes the border to Fixed3D.
   FormBorderStyle = FormBorderStyle.Fixed3D
   
   ' Displays the border information.
   label1.Text = "The border is " + FormBorderStyle
End Sub 'InitMyForm

注解

此枚举由 Form 类使用。This enumeration is used by the Form class. 它表示窗体的不同样式。It represents the different styles of the form. 默认样式为SizableThe default style is Sizable.

适用于

另请参阅