如何在wpf(XAML)中的标签中显示日期 [英] How to display date in label in wpf(XAML)

查看:458
本文介绍了如何在wpf(XAML)中的标签中显示日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在wpf(XAML)中的文本之间显示标签中的日期:



例如:您没有为%date%分配工作。咨询你的管理员。





代替日期应该显示实际日期,然后必须显示剩余的文字。 />
请有人能为我提供解决方案

解决方案

 < ;   label     x:name   =  SomeLabel    xmlns:x   = #unknown >  
Content ={Binding BilledDate}
ContentStringFormat =dd MMM yyyy/> < ; / label >



请参阅http://msdn.microsoft.com/en-us/library/sy stem.windows.controls.contentcontrol.contentstringformat.aspx


How to display the date in label in between the text in wpf(XAML):

For example: You have no work assigned for %date%. consult your admin.


in place of date it should display the actual date, then the remaining text has to be displayed.
please can anyone provide me with a solution

解决方案

<label x:name="SomeLabel" xmlns:x="#unknown">
       Content="{Binding BilledDate}"
       ContentStringFormat="dd MMM yyyy" /></label>


See the http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.contentstringformat.aspx


这篇关于如何在wpf(XAML)中的标签中显示日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆