Click here to Skip to main content
13,145,068 members (55,714 online)
Click here to Skip to main content
Add your own
alternative version

Stats

3.9K views
203 downloads
4 bookmarked
Posted 3 Jul 2017

Metro Color Picker

, 3 Jul 2017
Rate this:
Please Sign up or sign in to vote.
ColorPicker with Metro interface

Introduction

MetroColorPicker control is a color picker with Metro interface, you can simply select any common color used in Metro theme or by adding it using it Hexadecimal code, in addition MetroColorPicker contains another feature which is the ability to choose the colors via Windows color interface in case you don't have the appropriate choice or Hexdecimal-Form of your chosen color. 

                   

Features 

  • MetroColorPicker is very easy to use, self built, it provides random common colors boxes, 

or you can your own custom colors using either by using it hexadecimal or by using the Windows's color interface.

  • Works in VB.Net & C#.

Requirements

  •  .Net Framework Version 3.5 and above.

Using the Code

Get Color selected from MetroColorPicker : 

VB.NET :
'Get Color

Dim Color as Color 

Color = MetroColorPicker1.ColorInitial
C# :
// Get Color 

   Color Col_A ;

   Col_A = metroColorPicker1.ColorInitial;

Set Color to MetroColorPicker : 

VB.NET : 
' Example Set White 

MetroColorPicker1.ColorInitial = Color.White
C# :
// Example set Yellow : 

   metroColorPicker1.ColorInitial = Color.Yellow 

Get the Color selected when color change(Event): 

VB.NET :
'Example Change BackColor Form 
 
Private Sub MetroColorPicker1_ColorChanged(EventNumber As Integer) Handles MetroColorPicker1.ColorChanged
        Me.BackColor = MetroColorPicker1.ColorInitial
End Sub
C# :
// Example Change BackColor Form 

  private void metroColorPicker1_ColorChanged(int EventNumber)
        {
            this.BackColor = MetroColorPicker1.ColorInitial;
        }

The Events 

 ColorChanged - Is raised when Color changes

The Properties

 ColorInsital  - (Read/Write) Get and Set the Color 

Points of Interest

         

  • Color can be changed at the beginning through properties
  • If the hexadecimal system input code is incorrect, MetroColorPicker provides a random color

 

License

This article, along with any associated source code and files, is licensed under The Creative Commons Attribution 3.0 Unported License

Share

About the Author

Bessem Bousselmi
Software Developer
Tunisia Tunisia
.Net Developer

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170915.1 | Last Updated 3 Jul 2017
Article Copyright 2017 by Bessem Bousselmi
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid