Microsoft KB Archive/257529

= FIX: MonthView's Year is Changed When Setting DayofWeek Property =

Article ID: 257529

Article Last Modified on 8/7/2007

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q257529



SYMPTOMS
When you try to set the DayOfWeek property of the MonthView control to one of the enumerated constants in code, the MonthView's year changes to 1899. This behavior starts occurring after you have changed the date in the MonthView control.



CAUSE
When you try to set the DayOfWeek property to one of the enumerated constants, it is actually setting the value property of the control.



Step-by-Step Workaround Procedure
 Create a new Standard EXE project. Form1 is created by default. From the Project menu, select Components, select Microsoft Windows Common Controls-2 6.0, and then click OK. Add a MonthView control and a CommandButton to Form1.  Add the following code to the General Declarations section of Form1: Private Sub Command1_Click MonthView1.Value = MonthView1.Value - MonthView1.DayOfWeek + mvwSunday End Sub  Run the Project. Click on the MonthView control to change the date. Now click the CommandButton. Click the CommandButton again, and note that the year is correct.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed

To download the latest Visual Studio service pack, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/vstudio/Aa718353.aspx

<div class="moreinformation_section">

Steps to Reproduce Behavior
<ol> Create a new Standard EXE project. Form1 is created by default.</li> From the Project menu, select Components, select Microsoft Windows Common Controls-2 6.0, and then click OK.</li> Add a MonthView control and a CommandButton to Form1.</li>  Add the following code to the General Declarations section of Form1: Private Sub Command1_Click MonthView1.DayOfWeek = mvwSunday End Sub </li> Run the project.</li> Click on the MonthView control to change the date. Now click the CommandButton. Click the CommandButton again, and note that the year is changed to 1899.</li></ol>

Additional query words: sp4

Keywords: kbbug kbctrl kbfix kbvs600sp4fix kbvs600sp5fix KB257529

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.