Ok, so before you ask why on earth would you bother let me explain 🙂

As part of my work over at ClarionAddins I am always looking for way to improve the user experience as well as stretching my knowledge of .Net programming. I thought it might be nice to use WPF but since the Clarion IDE is targeting v2.0 of the .Net framework this is not so easy. Hence this example!

Of course there are many resources out there related to this topic, see below, but nothing I could discover specific to v2.0 so for me it took a little work to get there. I learnt a lot about reflection along the way!

This code assumes that the v3.5 Framework is installed on the target machine. For production it would of course be necessary to test for this and react accordingly.

Here is a screenshot of this technique being used in an addin I am working on:

WPF UserControl in an Addin Pad!

-brahn

 

Inspired by a recent newsgroup thread and my latest experiments in Clarion –> DotNet interop I have put together a simple program that shows you how to use the Zeta Color Editor from a clarion app!

image

 

The Zeta Color Editor is from an article in The Code Project and I have adapted it slightly to include a “Clarion Code” entry control as well as the “HTML code” it comes with. You may remember this control from the awesome InsertClarionColor addin.

This is the complete C# code used to call the Zeta Color Editor:

The clarion declaration looks like this:

The zip file contains a clarion 8 solution (app file, etc), compiled exe for the impatient, the C# wrapper (ColorPicker.dll) and the ZetaColorEditor.dll. This should be everything you need to do your own testing. The original source for the ZetaColorEditor is found at the Code Project link at the beginning of this post, my customisations can be found at the clarion-addins google project page.

Download: download ColorPickerTest.zip
Version: 0.1
Updated: September 20, 2011
Size: 852.29 KB
Downloads: 582