Table of contents
TOC
折叠目录
展开目录

Form.BorderStyle 属性 (访问)Form.BorderStyle Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

指定的边框和边框元素 (标题栏、控制菜单、最小化最大化按钮或关闭按钮) 用于窗体的类型。通常情况下,普通窗体、 弹出式窗体和自定义对话框需要使用不同的边框样式。读取/写入字节Specifies the type of border and border elements (title bar, Control menu, Minimize and Maximize buttons, or Close button) to use for the form. You typically use different border styles for normal forms, pop-up forms, and custom dialog boxes. Read/write Byte.

语法Syntax

表达式边框样式expression. BorderStyle

表达式_一个表示窗体对象的变量。_expression A variable that represents a Form object.

注解Remarks

对于控件,将边框样式属性使用以下设置。For controls, the BorderStyle property uses the following settings.

设置SettingVisual BasicVisual Basic说明Description
None00窗体没有边框或相关的边框元素。窗体大小不可调整。The form has no border or related border elements. The form isn't resizable.
Thin11窗体有细的边框,并且可以包含任何边框元素。窗体大小不可调整大小 (控制菜单上的大小命令不可用)。弹出式窗体经常使用此设置。(如果您希望保持在所有的 Microsoft Access 窗口顶部的窗体,您必须还其将PopUp属性设置为是。)The form has a thin border and can include any of the border elements. The form isn't resizable (the Size command on the Control menu isn't available). You often use this setting for pop-up forms. (If you want a form to remain on top of all Microsoft Access windows, you must also set its PopUp property to Yes.)
可调边框Sizable22(默认值) Microsoft Access 窗体的默认边框,可以包含任何边框元素,而且可以调整大小。普通的 Microsoft Access 窗体经常会用到该设置。(Default) The form has the default border for Microsoft Access forms, can include any of the border elements, and can be resized. You often use this setting for normal Microsoft Access forms.
对话框Dialog33窗体有粗边框 (双线),可以包含仅标题栏、关闭按钮和控制菜单。窗体不能最大化、 最小化或调整大小 (最大化最小化大小命令不可用控制菜单上)。通常将该设置用于自定义对话框。(不过,如果希望窗体为模式,您必须将其Modal属性设为是。如果您希望其成为模式弹出式窗体,类似于大多数对话框,您必须设置其PopUpModal属性都为是。The form has a thick (double) border and can include only a title bar, Close button, and Control menu. The form can't be maximized, minimized, or resized (the Maximize, Minimize, and Size commands aren't available on the Control menu). You often use this setting for custom dialog boxes. (If you want a form to be modal, however, you must also set its Modal property to Yes. If you want it to be a modal pop-up form, like most dialog boxes, you must set both its PopUp and Modal properties to Yes.)

窗体, BorderStyle属性建立的特性使得视觉上即可识别窗体是普通窗体、 弹出式窗体或自定义对话框。您还可以设置模式和进一步的PopUp属性定义窗体的特性。For a form, the BorderStyle property establishes the characteristics that visually identify the form as a normal form, a pop-up form, or a custom dialog box. You may also set the Modal and PopUp properties to further define the form's characteristics.

您也可以设置窗体的ControlBox关闭按钮滚动条导航按钮记录选择器属性。这些属性按以下方式相互作用:You may also want to set the form's ControlBox, CloseButton, MinMaxButtons, ScrollBars, NavigationButtons, and RecordSelectors properties. These properties interact in the following ways:

  • 如果边框样式属性设置为无或对话框中,该窗体没有最大化最小化按钮,而不考虑其属性设置。If the BorderStyle property is set to None or Dialog, the form doesn't have Maximize or Minimize buttons, regardless of its MinMaxButtons property setting.

  • 如果边框样式属性设置为 None,则窗体没有控制菜单,而不考虑它的ControlBox属性设置。If the BorderStyle property is set to None, the form doesn't have a Control menu, regardless of its ControlBox property setting.

  • 边框样式属性设置不会影响显示滚动条、 导航按钮、 记录编号框或记录选择器。The BorderStyle property setting doesn't affect the display of the scroll bars, navigation buttons, record number box, or record selectors.

边框样式属性只能在窗体视图中生效。在窗体设计视图中,则忽略属性设置。The BorderStyle property takes effect only in Form view. The property setting is ignored in form Design view.

如果弹出式窗体的边框样式属性设置为无,则将无法关闭该窗体,除非将关闭按钮添加到它所运行的宏包含Close操作或关闭使用的 Visual Basic 中的事件过程方法。If you set the BorderStyle property of a pop-up form to None, you won't be able to close the form unless you add a Close button to it that runs a macro containing the Close action or an event procedure in Visual Basic that uses the Close method.

弹出式窗体通常固定的大小,但可以使弹出式窗体可调整大小将其PopUp属性设为是并将其边框样式属性设置为可调。Pop-up forms are typically fixed in size, but you can make a pop-up form sizable by setting its PopUp property to Yes and its BorderStyle property to Sizable.

另请参阅See also

概念Concepts

窗体对象Form Object

© 2018 Microsoft