当前位置: 首页 > news >正文

免备案做网站 可以盈利吗网站的设计流程

免备案做网站 可以盈利吗,网站的设计流程,经典设计产品,重庆城乡建设委员会证书查询官网WPF文本绑定显示格式StringFormat设置 特殊格式设置日期/时间使用系统默认样式自定义格式: 绑定多个属性(多重绑定)多重绑定中的特殊字符示例: 特殊格式设置 在Textblock等文本控件中,我们经常要显示一些日期和时间&a…

WPF文本绑定显示格式StringFormat设置

  • 特殊格式设置
  • 日期/时间
    • 使用系统默认样式
    • 自定义格式:
  • 绑定多个属性(多重绑定)
    • 多重绑定中的特殊字符
    • 示例:

特殊格式设置

在Textblock等文本控件中,我们经常要显示一些日期和时间,默认显示的日期,不是我们想要的,所以需要自定义格式,还有多个数据可能需要绑定到一个文本中,都可以通过设置StringFormat来实现

日期/时间

使用系统默认样式

<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:d}}" />
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:D}}" />
<TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:m}}" />
<TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:M}}" />
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:f}}" />
<TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:F}}" />
<TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:g}}" />
<TextBlock Grid.Row="7" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:G}}" />
<TextBlock Grid.Row="8" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:t}}" />
<TextBlock Grid.Row="9" Grid.Column="1" Text="{Binding DtNow, StringFormat={}{0:T}}" />

显示效果如下:
在这里插入图片描述

自定义格式:

<TextBox Text="{Binding DtNow, StringFormat={}{0:yyyy年MM月dd日}}" />
<TextBox Text="{Binding DtNow, StringFormat={}{0:yyyy-MM-dd}}" />
<TextBox Text="{Binding DtNow, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />

也可以简化直接写日期格式

  <TextBlock Text="{Binding DtNow,StringFormat='yyyy年MM月dd日'}"/><TextBlock Text="{Binding DtNow,StringFormat='yyyy:MM:dd HH:mm:ss'}"/>

显示效果如下
在这里插入图片描述

绑定多个属性(多重绑定)

一个文本控件绑定多个属性合并显示,使用MultiBinding,在StringFormat中设置绑定格式{0}代表第一个属性,{1}代表第二个属性,以此类推

 <TextBlock><TextBlock.Text><MultiBinding StringFormat="数据计算:{0}/{1}={2}"><Binding Path="Value1" /><Binding Path="Value2" /><Binding Path="Result" /></MultiBinding></TextBlock.Text></TextBlock>

显示效果
在这里插入图片描述

多重绑定中的特殊字符

    \a  &#x07;  BEL\b  &#x08;  BS - Backspace\f  &#x0c;  FF - Formfeed\n  &#x0a;  LF, NL - Linefeed, New Line\r  &#x0d;  CR - Carriage return\t  &#x09;  HT - Tab\v  &#x0b;  VT - Vertical Tabelator &gt;     >(右箭头)

示例:

<TextBlock><TextBlock.Text><MultiBinding StringFormat="数据计算:{0}/{1}--&gt;{2}"><Binding Path="Value1" /><Binding Path="Value2" /><Binding Path="Result" /></MultiBinding></TextBlock.Text></TextBlock><!---->

效果
在这里插入图片描述

http://www.dinnco.com/news/61325.html

相关文章:

  • 张家港网站哪家做的好网络营销心得体会800字
  • 实惠网站建设国内可访问的海外网站和应用
  • 赌球网站如何做代理网络推广的主要内容
  • 宝鸡市城乡建设规划局官方网站线上推广有哪些渠道
  • 做网站所用的工具百度关键词搜索排名多少钱
  • 网站设置首页连接分类页的视频教程app推广公司
  • 网站建设与动态网页网店培训班
  • 专门做汽车gps贷款网站百度推广有哪些售后服务
  • 网站开发中安全性免费网站电视剧全免费
  • 自己做网站都要什么手续网店代运营公司哪家好
  • 广州建设集团有限公司广州seo全网营销
  • 做纸贸易的好网站网络推广运营主要做什么
  • 企业企业网站建设兰州怎么提高网站的排名
  • 做盗链网站seo培训师
  • 英文淘宝网站建设网站推广优化怎么做最好
  • 创业做招聘网站靠谱吗seo网站优化方案案例
  • 网页设计工资一般多少钱一小时seo站群优化技术
  • 琼海做网站口碑百度快速收录入口
  • 国家建设工程质量检查标准网站51链
  • wordpress 数据库解析什么是白帽seo
  • 房地产网站推广如何做网站设计
  • 阆中住房城乡建设委官方网站收录网站排名
  • 政府网站开发源码seo搜索引擎优化工作内容
  • 怎么做企业网站百度指数指的是什么
  • 机械行业网站建设制作开发方案百度6大核心部门
  • 集团公司网站源码php企业网站多少钱一年
  • 做网站的叫云啥怎样制作一个网页
  • 个人兴趣网站设计站长之家ppt素材
  • 分析杭州高端网站建设开发的区别培训机构网站设计
  • django 做网站赚钱seo营销排名