WPF日期为dd-MM-yyyy [英] WPF date forrmate to dd-MM-yyyy

查看:107
本文介绍了WPF日期为dd-MM-yyyy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用VS2010在wpf应用程序中以dd-MM-yyyy格式显示日期格式

解决方案

您通常使用StringFormat属性来设置控件的方式显示日期等。像这样: -



 <  < span class =code-leadattribute> textbox     text   =  {Binding Path = YourDate,StringFormat ='dd MMM yyyy'}    /  >  



这将将日期显示为 2012年1月13日



希望这有助于


关于MM / dd / yyyy HH:mm:ss格式,请查看有关自定义格式的符号'/'的MSDN文档 http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx#dateSeparator

XML:LANG = 烯IN



在您的窗口或页面中使用上述标签...



所有控件都在窗口或页面遵循上面提到的语言..



日期自动显示dd-MM-yyyy ..


How can i display date formats in dd-MM-yyyy format in wpf application using VS2010

解决方案

You generally use the StringFormat attribute to set the way a control displays dates etc. Something like this :-

<textbox text="{Binding Path=YourDate, StringFormat='dd MMM yyyy'}" />


This will show the date as 13 Jan 2012

Hope this helps


about "MM/dd/yyyy HH:mm:ss" format, please look at MSDN documentation about symbol '/' for custom formats http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx#dateSeparator


xml:lang="en-IN"

use the above tag in your window or page...

all controls on the window or page follow the above menctioned language..

the date automatically displayed dd-MM-yyyy..


这篇关于WPF日期为dd-MM-yyyy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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