Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Outlook Calendar Look and Feel - Corrupts Form Designer
 

Outlook Calendar Look and Feel - Corrupts Form Designer

I added the CalendarLibrary project (Outlook Calendar Look and Feel) to my solution.  First I encountered the Serialization problem and used the fix listed here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=167334&SiteID=1

I add a reference from my VB project to the CalendarLibrary project, add a new form to my VB project and drag and drop the Calendar control onto the form.  When I build the solution I get this error:

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.

Object of type 'System.Collections.Generic.List`1[CalendarLibrary.CalendarItem]' cannot be converted to type 'System.Collections.Generic.List`1[CalendarLibrary.CalendarItem]'.

Hide    

at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

At one point I was able to temporarily fix the problem by starting over, removing the CalendarLiberary reference, deleting the form containing the calendar, closing VS 2005, deleting the bin and obj directories and I forget what else.  For a while I had the CalendarLibrary control working.  I felt great relief, then the darn error re-appeared.  If anyone has any helped I'd greatly appreciate it.  This calendar control is exactly what I need in my project, if it would only WORK!
 
Thanks in advance.

DeveloperDan  Monday, January 16, 2006 5:35 PM

I have a solution to this Calendar problem. I gave up on the "Outlook Calendar Look and Feel" when I found an alternateversion atSzymon Kobalczyk's blog entry --Poor Man's Schedule Component for Windows Forms at:

http://geekswithblogs.net/kobush/archive/2006/01/02/64660.aspx?Pending=true

The code is simple, the Calendar looksgreat and the existing properties and methods suit my needs. Szymon is considering posting the code at ProjectDistributor. I'd be interested in any features he or others add to it.

DeveloperDan  Wednesday, January 25, 2006 9:05 PM
Same thing happen to me. I fixed it by cleaning out the bin directory and everything work fine for a while; now I get the same error message that you're getting in the designer.
bafoster95  Monday, January 16, 2006 8:56 PM

If you are reading this and can spare a moment try the sample from Microsoft called "Outlook Calendar Look and Feel" at the www.WindowsForms.net Samples tab:

 http://www.windowsforms.net/Default.aspx?tabindex=4&tabid=49#WinForms%20V2%20Demo%20App

It's a potentially terrific calandar control to place on any WinForms app.  Let me know if you can successfully add it to another form without the nasty error msgs (see above).  I'd really like to get a calendar control in my app that shows at a glance what days of the month have various items scheduled.  Any suggestions for alternate methods are appreciated.

Thanks!

DeveloperDan  Thursday, January 19, 2006 4:46 PM

I have a solution to this Calendar problem. I gave up on the "Outlook Calendar Look and Feel" when I found an alternateversion atSzymon Kobalczyk's blog entry --Poor Man's Schedule Component for Windows Forms at:

http://geekswithblogs.net/kobush/archive/2006/01/02/64660.aspx?Pending=true

The code is simple, the Calendar looksgreat and the existing properties and methods suit my needs. Szymon is considering posting the code at ProjectDistributor. I'd be interested in any features he or others add to it.

DeveloperDan  Wednesday, January 25, 2006 9:05 PM
I got the same problem:

Object of type
'System.Collections.Generic.List`1[my business class]' cannot be converted to type 'System.Collections.Generic.List`1[my business class]'.

Strange.


Ulrik  Thursday, March 09, 2006 10:11 AM

I have some information which might help ... I have listed all the steps I went through here even though some may not need ... I am using the express versions of VB & C#

Fix serialization & add control to a VB form:

  1. unzip,build &run in c#
  2. modify codein c#, build, run (Calendar Library, CalendarItem.cs - add 2 lines in, see below, lines marked with >>)
  3. create a new vb project
  4. copy C:\...\OutlookCalendar\Demo\bin\Release\CalendarLibrary.dll
    to the vb project dir
  5. in the vb proj: tools, choose toolbox items, .net framework components, browse,add .dll in vb project dir (CalendarLibrary.dll)

Source Code:

using System.Text;
>>using System.Runtime.Serialization;

namespace CalendarLibrary
{
>>[Serializable]
public class CalendarItem

I think theObject of type 'System.Collections.Generic.List`1...error may depend on how you open the project (i.e. directly from the .sln file or from inside the ide)
or it may be related towhich class file or form is left open when the ide is closed - I've found it comes and goes depending on these things ...

a_SteveH_  Wednesday, April 05, 2006 9:09 AM
If you change the CalendarItems property in Calendar.cs to have 'internal' access on the setter this error will go away, I believe, like so:

public List<CalendarItem> CalendarItems
{
get
{
return m_items;
}
internal set
{
m_items = value;
}
}

NOTE: you will have to delete the control from any forms, possibly even by manually editing InitalizeComponent to remove the designer generated assignment to the collection.

d4ljoyn  Saturday, April 22, 2006 9:57 PM

Hi Steve,

On carrying out steps upto 5 fix serializarion error, on running the solution get the following error:

Any feedback/help would be appreciated

regards

Error msg:

System.ArgumentException was unhandled
Message="Assembly 'I:\\Visual Studio 2005 Samples\\OutlookCalendar\\CalendarLibrary\\obj\\Debug\\CalendarLibrary.dll' doesn't contain any UserControl types."
Source="UserControlTestContainer"
StackTrace:
at Microsoft.VisualStudio.Tools.UserControlTestContainer.UserControlTestContainer_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.VisualStudio.Tools.UserControlTestContainer.Main(String[] args)

dsani  Tuesday, June 13, 2006 4:29 PM
Hi Steve
The outlook look and feel calendar is very good
but i am getting an issue when trying to get the selected date

can u plz tell me how to retrieve the selected date?

Thank in advance
nagasridhar madiraju  Friday, December 05, 2008 2:18 PM

You can use google to search for other answers

Custom Search

More Threads

• CType(resources.GetObject(), Boolean) in Windows generated code
• What's up with the stats page?
• Terrarium 1.2 Server -> charts fix
• Username and password
• how many people are using a perticuler url is being used in enteir world
• Have trouble introducing my own bug
• Terrarium Setup Help
• Creating Setup file
• Multi-part question in regards to functionality
• Problems