Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

WPF Color Picker Construction Kit

, 26 Dec 2010 CPOL
A WPF color picker (like Adobe's) constructed in a modular fashion for easy modification.
ColorPickerDemo.zip
ColorPicker.dll
ColorPickerControls.dll
ColorPickerDemo.exe
ColorPickerSource.zip
ColorPickerDemo
ColorPicker
ColorModels
CMY
CMYK
HSB
Lab
RGB
ExtensionMethods
Properties
Settings.settings
Resources
ColorPickerControls
Chips
Dialogs
Pickers
Properties
Settings.settings
ColorPickerDemo
ColorPickerDemo.ico
Properties
Settings.settings
<UserControl x:Class="ColorPicker.ColorModels.RGB.RgbDisplay"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Width="auto"
             Height="auto">
    <Grid>
        <Grid.Resources>
            <Style TargetType="{x:Type TextBox}">
                <Setter Property="Width" Value="40" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="Margin" Value="2,2,2,2"/>
            </Style>
            <Style TargetType="{x:Type RadioButton}">
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="auto" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <!--Row 1-->
        <RadioButton Name="rR" Checked="rR_Checked" IsChecked="False">R:</RadioButton>
        <TextBox Grid.Column="1"  Height="23" HorizontalAlignment="Left"  Name="txtR" PreviewTextInput="txtR_PreviewTextInput" TextChanged="TextChanged" />
        <TextBlock Text="" Grid.Column="2" Name="txtRUnit" />
        <!--Row 2-->
        <RadioButton Grid.Row="1" Name="rG" Checked="rG_Checked">G:</RadioButton>
        <TextBox Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left"  Name="txtG" TextChanged="TextChanged" />
        <TextBlock Text="" Grid.Column="2" Name="txtGUnit" Grid.Row="1"/>
        <!--Row 3-->
        <RadioButton Grid.Row="2" Name="rB" Checked="rB_Checked">B:</RadioButton>
        <TextBox Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left"  Name="txtB" TextChanged="TextChanged" />
        <TextBlock Text="" Grid.Column="2" Name="txtBUnit" Grid.Row="2"/>
    </Grid>
    
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

KenJohnson
Software Developer (Senior)
United States United States
Written software for what seems like forever. I'm currenly infatuated with WPF. Hopefully my affections are returned.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141223.1 | Last Updated 26 Dec 2010
Article Copyright 2010 by KenJohnson
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid