您的位置:首页 > Web前端

[WPF]The differences between Text Box and Text Block in Blend

2010-02-07 19:15 519 查看
Both TextBlocks and TextBoxes can be used to display text, they can be set to specific Height and Width or be set to Auto so that they grow in size with the text. They can both set font size, font type, font styling, to wrap and to range left, right or centred. Both TextBlocks and TextBoxes can have opacity set and have Pixel Shaders applied. Although at first the TextBlock and TextBox look like they do very similar things, they do actually have very different functions.

The TextBlock

TextBlocks are used for displaying text more focused typographically. TextBlocks can contain text set to different colors, fonts and sizes. The line height can also be increased from the default setting to give more space between each line of text. Text inside a TextBlock can not be made selectable by the user.

个性化强,不强调输入和改变性

The TextBox

TextBoxes are used for displaying text more focused for content input or when content is needed to be made selectable by the user. The TextBox can only be set to one colour, one font size, one font type etc. TextBoxes also have fixed Line Spacing. The TextBox can also be set to a fixed height and width but also have scrollbars switched on to allow content to expand.

统一性强,强调输入和改变性
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: