Stephan Leban的MonthCalendar中的周数 [英] Week Numbers in Stephan Leban's MonthCalendar

查看:94
本文介绍了Stephan Leban的MonthCalendar中的周数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到Stephan Leban'的MonthCalendar中的周数与Microsoft Outlook不一致(它们向前移动了一周)。有什么办法可以通过更改模块中的内容或Stephan''s MonthCalendar中的代码来同步这两个吗?

谢谢,

TySmith


-

通过 http://发布消息www.accessmonster.com

解决方案
您好泰,

中的类目前不公开theSetFirstDayOfTheWeek属性。如果

这是您需要的财产让我知道,我会发布一些代码,以便您将

添加到课程中。

以下是来自MSDN的信息。

MCM_SETFIRSTDAYOFWEEK消息


--------------------- -------------------------------------------------- -

--------


设置一个月日历控件的一周的第一天。您可以明确地或使用MonthCal_SetFirstDayOfWeek

宏发送此消息。


语法

要发送此消息,请按如下方式调用SendMessage函数。

lResult = SendMessage(//在lResult(HWND)中返回LRESULT

hWndControl,//句柄到目标控件( UINT)

MCM_SETFIRSTDAYOFWEEK,//消息ID(WPARAM)的wParam,// =

0;不使用,必须是零(LPARAM)的lParam // =(LPARAM) (INT)

iDay;);

参数


wParam

必须为零。

iDay

int类型的值,表示将哪一天设置为第一天

。该值必须是日期数之一。

返回值


返回包含两个值的DWORD值。高位字是一个BOOL

值,如果前一周的第一天不等于
等于LOCALE_IFIRSTDAYOFWEEK,则为非零值,否则为零。低字是一个INT

值,表示一周的前一天。

备注


如果是第一天本周设置为除默认值之外的其他任何内容(LOCALE_IFIRSTDAYOFWEEK),控件不会自动更新

基于区域设置的第一天的第一天更改更改。

月份日历日数


------------------------ ------------------------------------------------ <无线电通信/>
--------


本节列出了一周中几天的数字表示
每月使用的
日历控制。


常数


价值

星期几


0

周一


1

周二


2

星期三


3

星期四


4

星期五




周六


6

周日


-


HTH

Stephen Lebans
http://www.lebans.com

访问代码,提示和技巧

请只回复新闻组,以便每个人都能受益。

Ty Smith通过AccessMonster.com < FO *** @ AccessMonster.com>写在

消息新闻:17 ****************************** @ AccessMonste r.com。 ..

我注意到Stephan Leban'的MonthCalendar中的周数是
与Microsoft Outlook不一致(他们被转移了一周

前进)。有没有什么方法可以通过更改模块中的某些东西或Stephan''s MonthCalendar中的代码来同步这两个?谢谢,
TySmith

-
通过发布的消息http://www.accessmonster.com




我刚刚看了MS OUtlook中的日历配置选项。

为了让我的MonthCalendar同步一周,你可以使用

来:

菜单 - >工具 - 选项。

选择日历选项。

将第一周更改为前4天周


Microsoft MonthCalendar常用控件注释:

MCS_WEEKNUMBERS

版本4.70。月历控件将在每行的左侧显示周数

(1-52)。第1周被定义为第一个

周,至少包含4天。


-


HTH

Stephen Lebans
http://www.lebans.com

访问代码,提示和技巧

请只回复新闻组,以便每个人都能受益。

Ty Smith通过AccessMonster .COM" < FO *** @ AccessMonster.com>写在

消息新闻:17 ****************************** @ AccessMonste r.com。 ..

我注意到Stephan Leban'的MonthCalendar中的周数是
与Microsoft Outlook不一致(他们被转移了一周

前进)。有没有什么方法可以通过更改模块中的某些东西或Stephan''s MonthCalendar中的代码来同步这两个?谢谢,
TySmith

-
通过发布的消息http://www.accessmonster.com




Stephan,

您的信息非常出色!我查了ISO 8601标准,我可以改变我的系统来适应这个标准。谢谢您的帮助。也许您可能需要在下一版强大的MonthCalendar中考虑这些不同的选项。

谢谢,

TySmith


- -

通过 http://www.accessmonster.com


I noticed that the week numbers in Stephan Leban''s MonthCalendar are not consistent with Microsoft Outlook (they are shifted one week forward). Is there any way I can sync these two up by changing something in the module or the code in Stephan''s MonthCalendar?
Thanks,
TySmith

--
Message posted via
http://www.accessmonster.com

解决方案

Hi Ty,
the class currently does not expose theSetFirstDayOfTheWeek property. If
this is the property you require let me know and I''ll post some code for
you to add to the class.
Here is the info from MSDN.
MCM_SETFIRSTDAYOFWEEK Message

------------------------------------------------------------------------
--------

Sets the first day of the week for a month calendar control. You can
send this message explicitly or by using the MonthCal_SetFirstDayOfWeek
macro.

Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult (HWND)
hWndControl, // handle to destination control (UINT)
MCM_SETFIRSTDAYOFWEEK, // message ID (WPARAM) wParam, // =
0; not used, must be zero (LPARAM) lParam // = (LPARAM) (INT)
iDay; );
Parameters

wParam
Must be zero.
iDay
Value of type int representing which day is to be set as the first day
of the week. This value must be one of the day numbers.
Return Value

Returns a DWORD value that contains two values. The high word is a BOOL
value that is nonzero if the previous first day of the week did not
equal LOCALE_IFIRSTDAYOFWEEK, or zero otherwise. The low word is an INT
value that represents the previous first day of the week.
Remarks

If the first day of the week is set to anything other than the default
(LOCALE_IFIRSTDAYOFWEEK), the control will not automatically update
first-day-of-the-week changes based on locale changes.
Month Calendar Day Numbers

------------------------------------------------------------------------
--------

This section lists the numeric representations of the days of the week
used by the month calendar control.

Constants

Value
Day of Week

0
Monday

1
Tuesday

2
Wednesday

3
Thursday

4
Friday

5
Saturday

6
Sunday

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Ty Smith via AccessMonster.com" <fo***@AccessMonster.com> wrote in
message news:17******************************@AccessMonste r.com...

I noticed that the week numbers in Stephan Leban''s MonthCalendar are not consistent with Microsoft Outlook (they are shifted one week
forward). Is there any way I can sync these two up by changing
something in the module or the code in Stephan''s MonthCalendar? Thanks,
TySmith

--
Message posted via http://www.accessmonster.com




I just had a peek at the Calendar config options In MS OUtlook.
To have my MonthCalendar synch up week swith Outlook''s you would have
to:
Menu -> Tools-Options.
Select Calendar Options.
Change First Week of year to "First 4 day week"

The Microsoft MonthCalendar common control notes:
MCS_WEEKNUMBERS
Version 4.70. The month calendar control will display week numbers
(1-52) to the left of each row of days. Week 1 is defined as the first
week that contains at least four days.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Ty Smith via AccessMonster.com" <fo***@AccessMonster.com> wrote in
message news:17******************************@AccessMonste r.com...

I noticed that the week numbers in Stephan Leban''s MonthCalendar are not consistent with Microsoft Outlook (they are shifted one week
forward). Is there any way I can sync these two up by changing
something in the module or the code in Stephan''s MonthCalendar? Thanks,
TySmith

--
Message posted via http://www.accessmonster.com




Stephan,
Your information is OUTSTANDING! I looked up the ISO 8601 standard and I can change my system to accomodate this standard. Thank you for your assistance. Maybe you may want to consider these various options in your next revision of your robust MonthCalendar.
Thanks,
TySmith

--
Message posted via http://www.accessmonster.com


这篇关于Stephan Leban的MonthCalendar中的周数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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