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名为Form1的。This 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

注解

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

适用于

另请参阅