Steven Houben Student Human-Computer Interaction

24Nov/090

A C# (.net) Extended Panel

What?

I was cleaning up my external HD and came across a project I did a few years ago. The idea behind the project was:

  1. Extend the standard System.Windows.Panel[1] with transparency and an alpha channel
  2. Master the use of  smart tags in Visual Studio (design time support for programmers)

shPanel

The shPanel control is an extension of the standard System.Windows.Panel [1] control. I basically derived the standard panel, added basic gradient support and build in an alpha channel for the gradient colors. The user can switch between UserDrawMode and SystemDrawMode. The latter uses the standard .net draw call and doesn't care about the added properties. The UserDrawMode on the other hand uses 2 colors and a gradient mode as input for a custom draw call. I have also added 2 schemes that basically set the GradientColor1 and GradientColor2 properties. I remember thinking about implementing a XML system for gradient definition but I guess I never came to that.

Next to the added functionality I also provided the control with smart tags so the User Interface designer can quickly access and change the most relevant properties of that control. In this case I assumed that the UserDrawMode was the the most relevant property as it decides how the control is rendered. Secondly It also made sense to me to add smart tags for all added functionality.

And yes sh is an abbreviation for my name :) .

Licence

Copyright (c) Steven Houben

This code is free software; you can redistribute it and/or modify it  under the terms of the GNU Lesser General Public License 3 or later, as published by the Free Software Foundation. Check  [2] for details.

Download

  1. Compiled DLL [Download] (1 file - DLL)
  2. Source Code [Download] (4 files: class files)
  3. Test + Source Visual Studio Project [Download] (32 files: 2 projects - no builds)

Support & contribution

I am not actively developing or supporting this control. However if you add functionality or find any bugs you may contact me via this blog (comment or email) and I will update the code.

Thanks to Phil Wright for tips on the use of smart tags. [3]

Reference

[1] http://msdn.microsoft.com/en-us/library/system.windows.controls.panel.aspx

[2] http://www.gnu.org/copyleft/lesser.html

[3] http://www.componentfactory.com/blog/2005/10/adding-smart-tags/

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.