惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - Kevin Lin

Happy New Year! HTTP状态码大全 [转]jquery的一个模板引擎-zt - Kevin Lin - 博客园 2009年3月 2008年9月-10月 跟ASP.NET MVC一起使用jQuery [摘自千寻网]给鼠标右键增加“见好就收”的功能 ASP.NET 2.0中的URL映射 在.net中使用Gmail发送邮件 [绝对原创]从VS2003(.net1.1)升级到vs2005(.net2.0)全程跟踪记录 使用Asp.net mvc + Linq + mvc_scaffold_gen_setup.exe 生成一个完整的家庭帐册大管家程序 之三 使用Asp.net mvc + Linq + mvc_scaffold_gen_setup.exe 生成一个完整的家庭帐册大管家程序 之二 2008年4月-5月 使用Asp.net mvc + Linq + mvc_scaffold_gen_setup.exe 生成一个完整的家庭帐册大管家程序 之一 XNA Game Studio 2.0 Released版 发布了,好像是前几天的事,但园子里似乎没有讯息嘛 向大家推荐一个不错的休闲游戏 农历js脚本 - Kevin Lin - 博客园 WEB开发碰到的问题及经验十八则 - Kevin Lin - 博客园 根据分辨率不同调用不同的css文件 - Kevin Lin - 博客园
VS2003(.net framework1.1)中,如果让日历控件的“星期”去掉?
Kevin Lin · 2007-11-23 · via 博客园 - Kevin Lin

首先,对自己目前仍然在“执着”地VS2003着,表示无比地难过和无奈,虽然之前也做过一段时间05的项目。
大家都知道03(.net1.1)中存在着很多不足,往往让人唉声叹气,特别是经过05的洗礼之后。
这不,产品经理看了别人05做的日历控件,非要我给她整个一模一样的。(03的日历控件总是会显示“星期*”或者“星”字样)
没办法了,以前也没有遇到过类似问题,网上求助阿。
最后在一个“如何使用DM建个人blog”的文章中找到答案,原来可以在日历的PreRender(object sender, System.EventArgs e)事件中实现。
代码如下:

 1/// <summary>
 2        /// 修改VS03日历的星期几的显示
 3        /// </summary>
 4        /// <param name="sender"></param>
 5        /// <param name="e"></param>

 6        private void Calendar1_PreRender(object sender, System.EventArgs e)
 7        {
 8            System.Threading.Thread dkWeek = System.Threading.Thread.CurrentThread;
 9            System.Globalization.CultureInfo dkNew = (System.Globalization.CultureInfo)System.Globalization.CultureInfo.CurrentCulture.Clone();
10            dkNew.DateTimeFormat.DayNames = new string[]{""""""""""""""};
11            dkNew.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Sunday;
12            dkWeek.CurrentCulture = dkNew;
13        }


其实主要是改变当前线程的区域性。
当然别忘了添加:

this.Calendar1.PreRender += new System.EventHandler(this.Calendar1_PreRender);

另外记得设置日历控件的DayNameFormat为Full(默认为Short),这样就可以了。
不知道大家以前是不是有遇到过类似问题,反正我是第一次主要到这个问题,写出来也算是一个备份吧。已经了解的博友就不要批我了:(