表單控制項

The Form Controls toolbar or sub-menu contains tools that you need to create an interactive form. You can use the toolbar or sub-menu to add controls to a form in a text, drawing, spreadsheet, presentation, or HTML document, for example a button that runs a macro.

若要使用此指令...

Choose View - Toolbars - Form Controls.

[插入] 工具列上的圖示 (最初此圖示是不可見的,因此您可能需要啟用此圖示):

Icon Select

表單控制項


note

XML 表單文件 (XForms) 使用相同的控制項組。


若要建立表單,請開啟文件並使用 [表單控制項] 工具列增加及定義表單控制項。還可視需要建立表單與資料庫的連結,以使用控制項操控資料庫。

建立 HTML 文件格式的表單時,可使用該表單經由網際網路傳送資料。

若要在文件中增加控制項

  1. On the Form Controls toolbar, click the icon of the control that you want to add.

  2. Then click in the document, and drag to create the control.

    tip

    To create a square control, hold down the Shift key while you drag.


tip

To add a field from the field list of a table or query to a form, drag a cell into the form. In a text document, you can also drag a column header to add a field to a form. To include a label for the field, hold down +Shift when you drag a column head.


修改控制項

  1. Right-click the control and choose Control Properties. A dialog opens where you can define the properties of the control.

  2. To specify a accelerator key for a control, add a tilde (~) in front of the character in the label for the control.

  3. 您可以使用拖放在文件之間複製控制項,或者先將控制項複製到剪貼簿中,然後再將它們貼上至新的文件中。同時,LibreOffice 分析三個屬性,即 [表單屬性] - [資料] 標籤頁中的「資料源」、「內容類型」和「內容」,以便將控制項插入目標文件邏輯表單結構中的正確位置。例如,顯示通訊錄內容的控制項,在被複製到目標文件中後,仍顯示通訊錄內容。此控制項將被插入到此目標文件的表單結構中或因此而建立表單結構。

選取

Icon Select

此圖示用於啟動或關閉滑鼠指標的選取模式。選取模式用於選取目前表單中的控制項。

Design Mode

Toggles the Design mode on or off. This function is used to switch quickly between Design and User mode. Activate to edit the form controls, deactivate to use the form controls.

Icon Design Mode

Design Mode On/Off

啟動或關閉精靈

Icon Toggle Form Control Wizards

開啟與關閉自動表單控制項精靈。

這些精靈可協助您輸入清單方塊、表格控制項和其他控制項的屬性。

表單設計

Icon Form Design Tools

開啟 [表單設計] 工具列。

貼標欄位

Icon Label Field

建立用於顯示文字的欄位。這些貼標僅顯示預先定義的文字,而無法在這些欄位中進行輸入。

文字方塊

Icon Text Box

建立文字方塊。文字方塊是使用者可以輸入文字的欄位。在表單中,文字方塊顯示資料或者允許輸入新資料。

核取方塊

Icon Check Box

建立核取方塊。使用核取方塊可以啟動或關閉表單中的某項功能。

選項按鈕

Icon Option Button

Creates an option button. Option buttons enable the user to choose one of several options. Option buttons with the same functionality are given the same name (Name property). Normally, they are given a group box.

清單方塊

Icon List Box

Creates a list box. A list box lets users select an entry from a list. If the form is linked to a database and the database connection is active, the List Box Wizard will automatically appear after the list box is inserted in the document. This wizard helps you create the list box.

組合方塊

Icon Combo Box

建立組合方塊。組合方塊是單行清單方塊,方塊中含有下拉式清單,使用者可以從其中選擇某個選項。可以將組合方塊指定為「唯讀」特性,這樣,使用者便無法輸入清單所含項目以外的其他項目。如果將表單連結到資料庫,而且資料庫連線處於使用中,則在文件中插入組合方塊後,螢幕上將自動顯示「組合方塊精靈」

按鈕

Icon Push Button

建立按鈕。此功能可用於執行已定義事件的指令,例如按一下滑鼠。

這些按鈕可以採用文字和圖形。

圖示按鈕

Icon image button

建立顯示為影像的按鈕。除了用圖形表示以外,影像按鈕與「普通」按鈕具有相同的屬性。

格式化的欄位

Icon Formatted Field

建立格式化的欄位。格式化的欄位是一個文字方塊,用於定義如何格式化輸入和輸出,並定義採用的限定值。

格式化的欄位具有特別的控制項屬性 (「格式」-「控制項」)。

日期欄位

Icon Date Field

建立日期欄位。如果將表單連結至資料庫,則可採用資料庫中的日期值。

If you assign the "Dropdown" property to the date field, the user can open a calendar to select a date under the date field. This also applies to a date field within a Table Control field.

tip

編輯日期欄位很容易,使用者僅需透過向上鍵或向下鍵,就可以增加或減少游標所在的日、月或年的值。


關於日期欄位的重要的提示

數字欄位

Icon Numerical Field

建立數字欄位。如果將表單連結至資料庫,則可採用資料庫中表單的數值。

群組方塊

Icon Group Box

Creates a frame to visually group several controls. Group boxes allow you to group option buttons in a frame.

If you insert a group frame into the document, the Group Element Wizard starts, which allows you to easily create an option group.

Note: When you drag a group box over already existing controls and then want to select a control, you have to first open the context menu of the group box and choose Arrange - Send to Back. Then select the control while pressing .

note

Group boxes are used only for a visual effect. A functional grouping of option fields can be made through the name definition: under the Name properties of all option fields, enter the same name in order to group them.


時間欄位

Icon Time Field

建立時間欄位。如果將表單連結至資料庫,則可套用資料庫中的時間值於表單。

tip

編輯時間欄位很容易,使用者僅需透過向上鍵或向下鍵,就可以增加或減少游標所在的小時、分鐘或秒的值。


貨幣欄位

Icon Currency Field

建立貨幣欄位。如果將表單連結至資料庫,則可在表單中採用資料庫中的貨幣欄位內容。

遮罩欄位

Icon Pattern Field

建立圖案欄位。圖案欄位由編輯遮罩和文字遮罩構成。編輯遮罩確定可以輸入的資料,文字遮罩則確定載入表單時圖案欄位的內容。

note

無法在 HTML 格式中顧及遮罩欄位。


表格控制項

Icon Table Control

Creates a table control to display a database table. If you create a new table control, the Table Element Wizard appears.

有關表格控制項的專用資訊

瀏覽位址列

Icon Navigation bar

Creates a Navigation bar.

The Navigation bar allows you to move through the records of a database or a database form. The controls on this Navigation bar work the same way as the controls on the default Navigation bar in LibreOffice.

圖式控制項

Icon Image Control

建立影像控制項。這只能用於從資料庫新增影像。在表單文件中,連按兩下這些控制項之一開啟 [插入圖形] 對話方塊以插入影像。同時也有右鍵功能表 (不在設計模式中) 具有插入和刪除影像的指令。

可以在表單中顯示資料庫中的影像,而且只要影像控制項未處於防寫入保護狀態,就可以將新影像插入到資料庫中。該控制項必須參照某個影像類型的資料庫欄位,因此,請在[資料]標籤頁上的屬性視窗中輸入該資料欄位。

選取檔案

Icon File Selection

建立用於選擇檔案的按鈕。

微調按鈕

Icon Spin Button

建立微調按鈕。

如果您在 Calc 工作表文件中增加一個微調按鈕,可使用 [資料] 標籤頁來建立該微調按鈕與儲存格之間的雙向連結。因此,當您變更儲存格內容時,微調按鈕的內容也會隨之更新。同理,如果您變更微調按鈕的值,儲存格內容也會隨之更新。

捲軸

Icon Scrollbar

建立捲軸。

您可以為捲軸指定以下特性:

UI 名稱

語義

最小捲動數值

指定捲軸的最小高度或最小寬度。

最大捲動值

指定捲軸的最大高度或最大寬度。

預設捲動值

指定表單重設時,捲動軸所用的預設值。

方向

指定捲軸的方向,也就是水平或垂直。

少量變更

指定可以捲動捲軸的最小值,例如,按一下箭頭。

大量變更

指定大幅度捲動捲軸的量,例如,當您在捲軸縮圖與捲軸箭頭之間按一下時。

延遲

在觸發事件之間,以毫秒為單位指定延遲。例如,在按一下捲軸的箭頭按鈕時與按住滑鼠按鈕時發生的延遲。

符號色彩

指定捲軸箭頭的顏色。

顯示大小

Specifies the size of the scrollbar thumb in "value units". For example, a value of ("Scroll value max." minus "Scroll value min.") / 2 results in a scrollbar thumb that occupies half of the scrollbar.

To make the width of the scrollbar equal to the height of the scrollbar, set the Visible Size to zero.


In a Calc spreadsheet, you can use the Data tab page to create a two-way link between a scrollbar and a cell.

Please support us!