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 – 此控件是允许用户输入 (Edit)、仅显示数据 (View),还是已禁用 (Disabled)。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.Text Source.Text

    虽然“HTML 文本”控件显示与“标签”控件相同的文本,但会将这些标记转换成相应的字符。The HTML text control shows the same text as the Label control but converts the tags to the appropriate characters.