PowerApps 中的 HTML 文字控制項HTML text control in PowerApps

顯示文字並將 HTML 標記轉換為格式的方塊。A box that shows text and converts HTML tags to formatting.

說明Description

HTML 文字控制項不只會顯示純文字和數字,也會轉換 HTML 標記 (例如不分行空格)。An HTML text control not only shows plain text and numbers but also converts HTML tags, such as non-breaking spaces.

主要屬性Key properties

Color – 控制項文字的色彩。Color – The color of text in a control.

Font – 文字可使用的字型家族名稱。Font – The name of the family of fonts in which text appears.

HTMLText – 出現在 HTML 文字控制項中而且可能包含 HTML 標記的文字。HTMLText – Text that appears in an HTML text control and that may contain HTML tags.

其他屬性Additional properties

BorderColor – 控制項框線的色彩。BorderColor – The color of a control's border.

BorderStyle – 決定控制項的框線為實線虛線點線BorderStyle – Whether a control's border is Solid, Dashed, Dotted, or None.

BorderThickness – 控制項框線的粗細。BorderThickness – The thickness of a control's border.

DisplayMode – 控制項允許使用者輸入 (編輯)、只顯示資料 (檢視) 或者已停用 (停用)。DisplayMode – Whether the control allows user input (Edit), only displays data (View), or is disabled (Disabled).

DisabledBorderColor – 控制項的 DisplayMode 屬性設為 Disabled 時,該控制項所呈現的框線色彩。DisabledBorderColor – The color of a control's border if the control's DisplayMode property is set to Disabled.

DisabledFill – 控制項的 DisplayMode 屬性設為 Disabled 時,該控制項所呈現的背景色彩。DisabledFill – The background color of a control if its DisplayMode property is set to Disabled.

Fill – 控制項的背景色彩。Fill – The background color of a control.

Height – 控制項的頂端和底部邊緣之間的距離。Height – The distance between a control's top and bottom edges.

HoverBorderColor – 使用者將滑鼠指標停留在控制項上時,該控制項所呈現的框線色彩。HoverBorderColor – The color of a control's border when the user keeps the mouse pointer on that control.

OnSelect – 在使用者點選或按一下控制項時,應用程式的回應方式。OnSelect – How the app responds when the user taps or clicks a control.

PaddingBottom – 控制項中文字與該控制項下邊緣之間的距離。PaddingBottom – The distance between text in a control and the bottom edge of that control.

PaddingLeft – 控制項中文字與該控制項左邊緣之間的距離。PaddingLeft – The distance between text in a control and the left edge of that control.

PaddingRight – 控制項中文字與該控制項右邊緣之間的距離。PaddingRight – The distance between text in a control and the right edge of that control.

PaddingTop – 控制項中文字與該控制項上邊緣之間的距離。PaddingTop – The distance between text in a control and the top edge of that control.

Size – 控制項上文字的字型大小。Size – The font size of the text that appears on a control.

Tooltip – 使用者將滑鼠指標停留在控制項上方時所顯示的說明文字。Tooltip – Explanatory text that appears when the user hovers over a control.

Visible – 控制項顯示或隱藏。Visible – Whether a control appears or is hidden.

Width – 控制項左邊緣與右邊緣之間的距離。Width – The distance between a control's left and right edges.

X – 控制項左邊緣與其父容器 (沒有父容器時則為螢幕) 左邊緣之間的距離。X – The distance between the left edge of a control and the left edge of its parent container (screen if no parent container).

Y – 控制項上邊緣與其父容器 (沒有父容器時則為螢幕) 上邊緣之間的距離。Y – The distance between the top edge of a control and the top edge of the parent container (screen if no parent container).

Find( FindString, WithinString )Find( FindString, WithinString )

範例Example

  1. 新增標籤控制項,並將其命名為 Source,然後將其 Text 屬性設定為這個字串:Add a Label control, name it Source, and set its Text property to this string:

<p> We have done an unusually &nbsp; &quot; deep &quot; globalization and localization.<p> We have done an unusually &nbsp; &quot; deep &quot; globalization and localization. <p><p>

不知道如何新增、命名和設定控制項嗎?Don't know how to add, name, and configure a control?

  1. 新增 HTML 文字控制項,並將其 HTMLText 屬性設定為此值:Add an HTML text control, and set its HTMLText property to this value:
    Source.TextSource.Text

    HTML 文字控制項會顯示與標籤控制項相同的文字,但將標記轉換成適當的字元。The HTML text control shows the same text as the Label control but converts the tags to the appropriate characters.