Library tutorials & articles
The ColorPicker WinForms Control
- Introduction
- The ColorEditor
- Finishing Up
- ColorPicker.vb Source Code
Introduction
- The control should look and act like a button.
- The button should be colored with the currently selected color and, optionally, it should display the currently selected color's name.
- Clicking the button should drop-down the built-in WinForms color selector and the control should change its appearance to a "pushed down" look.
The main design goals were implementation simplicity and the ability to reuse the control in either binary, or in source code form (VB.NET source code; just include the ColorPicker.vb file into your project and you're done).
The demo application
The following is the important part of the ColorPicker's public contract (the semantics should be self-explanatory):
Namespace LaMarvin.Windows.Forms
Public Class ColorPicker Inherits Control
Public Event ColorChanged As EventHandler
Public Property Color() As Color
For those of you in a hurry, you can download the control along with an accompanying demo application here.
But wait!
If you want to learn something about the inner workings of the WinForms design-time support, as well as some undocumented .NET framework tricks, please, read on.
Related articles
Related discussion
-
Why choose c# when there is Java
by Thaj06 (0 replies)
-
Change color while typing in rich text box
by Akhtar Hussain (0 replies)
-
Third party components to enhance User Interface of Windows based application
by Shaila14041981 (0 replies)
-
VB.NET DataGridView Sort
by bradhen (0 replies)
-
About Comparison in Asp.Net
by S_Rahul (0 replies)
Related podcasts
-
xpert to Expert: Inside Concurrent Basic (CB)
"Concurrent Basic extends Visual Basic with stylish asynchronous concurrency constructs derived from the join calculus. Our design advances earlier MSRC work on Polyphonic C#, Comega and the Joins Library. Unlike its C# based predecessors, CB adopts a simple event-like syntax familiar to VB progr...
Excellent control.
I have used it in win forms and it works quite nicly.
only one small issue. when you press the button and 3 tabbed popup drops down. if you click anywhere where out side that color selection, the whole form gets minimized.
for example if i have the button on the form and i press the button the color selection comes up. at this point instead of picking the color if i click any where on the form, the whole form goes to the backgroud (some other window comes in front.)
if you have a quick fix or a work around that will be great.
once again, Excellent work
Adeel
This thread is for discussions of The ColorPicker WinForms Control.