简体   繁体   中英

How to Install a 3rd party windows forms control?

I'm developing a WinForms app for my seminar using VS 2010 C# and I'm making a "booking" system. The problem is, the included MonthlyCalendar lacks the option to highlight certain dates, which is just disappointing to me...

Having said that, I decided to look around and found this: http://www.codeproject.com/Articles/10840/Another-Month-Calendar

It looks promising if only I knew how to install it on my Visual Studio 2010, since I see the last update was for v2005 + I don't even know how to install these controls :(

I once installed a 3rd party control but it had a DLL file which I could just drag and drop, and this one doesn't seem to have it...

If someone could lead me through it step by step, I would be most grateful!

Thank you

EDIT:

I just downloaded the .NET 2.0 version and found the DLL file, I dragged and dropped it and it installed, but when I tried to compile it it gives the following errors:

"The error is "The type or namespace name 'Pabo' could not be found (are you missing a using directive or an assembly reference?)."

+

"The referenced assembly "MonthCalendar" could not be resolved because it has a dependency on "System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project."

Your project is currently targetting, perhaps, framework 2.0

Right-click on your project file (in solution explorer) and go to properties. Then on the "Application" tab choose Framework 4.0;

To use the 3rd party control do the following

  1. Copy your dll next to your project. A sub-folder named "lib" is usually a good name
  2. In solution explorer right-click and choose "Add reference". Browse to your dll.
  3. Instantiate the class found at the DLL. If you do not know its namespace use the Object Browser right-clicking in your reference.
  4. Other alternative is to do it via your toolbox in WinForms In the link you provided it says the following

Like any other .NET control, for using in the IDE, you should add the MonthCalendar control to the Toolbox panel. This can be accomplished by right-clicking on a Toolbox tab and selecting "Add/Remove items...", browsing to the MonthCalendar assembly, and selecting it. This will add the MonthCalendar control to the Toolbox so that it can be dragged/dropped to a Windows Form.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM