FIX: MonthView's Year is Changed When Setting DayofWeek Property (257529)



The information in this article applies to:

  • Microsoft Visual Basic Learning Edition for Windows 6.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0

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.

RESOLUTION

Step-by-Step Workaround Procedure

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

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:

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new Standard EXE project. Form1 is created by default.
  2. From the Project menu, select Components, select Microsoft Windows Common Controls-2 6.0, and then click OK.
  3. Add a MonthView control and a CommandButton to Form1.
  4. Add the following code to the General Declarations section of Form1:
    Private Sub Command1_Click()
        MonthView1.DayOfWeek = mvwSunday
    End Sub
    					
  5. Run the project.
  6. 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.

Modification Type:MinorLast Reviewed:12/12/2005
Keywords:kbBug kbCtrl kbfix kbVS600sp4fix kbVS600sp5fix KB257529