#339 – 是按钮上的文字换行显示(Wrapping a Button’s Text Content to Multiple Lines)
来源:互联网 发布:绘画软件ipad 编辑:程序博客网 时间:2024/05/21 19:38
当Button 控件的大小是根据内容自适应的时候,它的大小将根据内容调整为完全显示说有文字,但是这样显示的文字只用一行显示。
<Button Content="Click me if you want to see something cool. In fact, click as many times as you like." HorizontalAlignment="Center" VerticalAlignment="Center"
但是如果你限制了按钮的宽度,有可能有些文字会被截断。
想要按钮上的文字自动换行,可以使用TextBlock 来显示按钮的文字来实现。你需要设置TextBlock 的TextWrapping 属性。
<Button HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10" Width="120"> <TextBlock Text="Click me if you want to see something cool. In fact, click as many times as you like." TextWrapping="Wrap"/></Button>
原文地址:https://wpf.2000things.com/2011/07/11/339-wrapping-a-buttons-text-content-to-multiple-lines/
0 0
- #339 – 是按钮上的文字换行显示(Wrapping a Button’s Text Content to Multiple Lines)
- as Button 的label和 Label 的text文字换行
- html按钮上文字的换行
- 如何获取字符串的屏幕显示长度,以及在button上文字换行。
- Android在Button按钮上同时显示文字和图片
- 如何使带背景图片的Button按钮中的文字居中偏上显示
- 点击按钮后禁止按钮并显示文字[正在处理...], getelementbyid button标签 text 赋值
- #347 – 通过Command设置按钮的内容(How to Set Content Property for Button Based on Command)
- #370 – 通过绑定显示当前时间(Binding a Label’s Content to the Current Date and Time)
- Inserting text in multiple lines
- Button上的文字显示为大写,已解决
- 按钮上文字动态显示
- 苹果手机上input的button按钮颜色显示问题
- button 中 text 换行
- Android点击Button按钮切换按钮文字显示
- #256 – 使用FixedDocument 在指定的地方显示内容(Use a FixedDocument to Display Content at Fixed Locations)
- 设置按钮上的文字靠左靠右居中显示
- C#在button按钮上显示箭头
- App集成小米推送
- 腾讯Bugly的使用
- MATLAB访问数组
- 简单的jsoup抓取html代码
- react native 真机调试appdelegate.m找不到ip地址的处理
- #339 – 是按钮上的文字换行显示(Wrapping a Button’s Text Content to Multiple Lines)
- mysql5.7安装
- opencv CvSolve函数深度解析
- 流媒体并发量与宽带、码率计算详解
- JVM中对象访问方式
- 触发和关闭hasLayout
- SOA理论篇(基本概念)
- js基础:数据类型,变量命名规范
- springMVC上传文件报错:The current request is not a multipart request