Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8432603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:10:21+00:00 2026-06-10T06:10:21+00:00

I’m trying to use a MonthCalendar Control that uses winforms, in a simple WPF

  • 0

I’m trying to use a MonthCalendar Control that uses winforms, in a simple WPF application. I found out that by using a WindowsFormsHost, winforms controls can be used in wpf apps. It worked for the built-in controls of winforms, but when I try to instantiate an object of this control MonthCalendar, I get an error saying “Cannot instantiate an object of MonthCalendar”.

Any suggestions as to why this is happening and how to overcome this?
The source code for MonthCalendar is available at http://www.codeproject.com/Articles/10840/Another-Month-Calendar?msg=2298161#xx2298161xx

Im instantiating it in xaml:

<Window x:Class="MonthCalendarTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    xmlns:pc="clr-namespace:Pabo.Calendar"
    Title="MainWindow" Height="350" Width="525">
<Grid Height="65" Width="280">

    <WindowsFormsHost Margin="0,0,12,12" Height="100">
        <pc:MonthCalendar></pc:MonthCalendar>

    </WindowsFormsHost>
</Grid>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:10:23+00:00Added an answer on June 10, 2026 at 6:10 am

    I can get it to work by following these steps:

    • using Visual Studio 2010
    • create new WPF Application
    • change platform to “.Net Framework 4” (NOT client profile)
    • add references to System.Windows.Forms and WindowsFormIntegration

    • download MonthCalendar from:
      http://www.codeproject.com/KB/selection/MonthCalendar/MonthCalendar_src_vs2005.zip

    • extract MonthCalendar, and add as existing project to Solution
    • change MonthCalendar platform to “.Net Framework 4” (NOT client profile)
    • delete and re-add the System.Design reference so that you use the .NET 4 one
    • in the WPF Application add reference to the MonthCalendar project
    • use the namespace reference xmlns:pc=”clr-namespace:Pabo.Calendar;assembly=MonthCalendar” in XAML

    enter image description here

    <Window x:Class="WpfApplication6.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
            xmlns:pc="clr-namespace:Pabo.Calendar;assembly=MonthCalendar"
        Title="MainWindow" Height="350" Width="525">
        <Grid Height="65" Width="280">
            <WindowsFormsHost Margin="0,0,12,12" Height="100">
                <pc:MonthCalendar x:Name="myCalendar"/>
            </WindowsFormsHost>
        </Grid>
    </Window>
    

    So what are you doing differently?

    Did you keep the MonthCalendar in it’s own project?

    What OS platform are you running on ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.