Introduction
While working on a project with an Office 2003 look, I needed a color picker with the exact look and feel of a Windows 2003 application. So, I’ve created one.
Using the code
The project has three controls that are available for use: OfficeColorPicker
, ComboBoxColorPicker
and ToolStripColorPicker
. The first two controls are ToolBoxItem
controls and therefore using them is as simple as dragging the control from the toolbox to your form. The third control is derived from ToolStripDropDownButton
and will be discussed later in this article. All of these controls have a Color
property to get or set the selected color of the control. Also, they have an event called SelectedColorChanged
that occurs when the selected color of the control changes.
OfficeColorPicker
This control holds all of the colors and functionality for color picking. It can be used modeless in the application by this code, where this
is a Form
or any other container:
// Creates new instance of the OfficeColorPicker,
// adds it to the form control.
// Note: you may use OfficeColorPicker(Color)
// to start with a specified color.
OfficeColorPicker officeColorPicker = new OfficeColorPicker();
this.Controls.Add(officeColorPicker);
Of course, the better way to open the color picker is as a pop-up, using the other two controls provided.
ComboBoxColorPicker
This control derives from System.Windows.Forms.ComboBox
to show the selected color in the ComboBox
. When clicking on the drop-down arrow, it will open the OfficeColorPicker
control in a pop-up with context menu behavior, i.e. it will close on selection or on loss of focus.
To use this combo box control:
// Creates new instance of the ComboBoxColorPicker,
// adds it to the form control.
// Note: you may use ComboBoxColorPicker(Color)
// to start with a specified color.
ComboBoxColorPicker comboBoxColorPicker =
new ComboBoxColorPicker();
this.Controls.Add(comboBoxColorPicker);
ToolStripColorPicker
This control derives from System.Windows.Forms.ToolStripDropDownButton
in order to allow using the button inside any xxxStrip
control. Examples include ToolStrip
, ContextMenuStrip
, MenuStrip
and any other controls that “know” to hold ToolStripItem
. To add ToolStripColorPicker
to ToolStrip
, use the following code:
// Creates a new tool strip to hold the ToolStripColorPicker:
ToolStrip toolStrip = new ToolStrip();
this.Controls.Add(toolStrip);
// Creates a new ToolStripColorPicker with starting color white
ToolStripColorPicker toolStripColorPicker =
new ToolStripColorPicker(Color.White);
// Adds the ToolStripColorPicker to the ToolStrip.
toolStrip.Items.Add(toolStripColorPicker);
An easier way of using ToolStripColorPicker
is to employ the design-time support of VS 2005. Just add ToolStrip
or any other xxxStrip
control to the form and use the drop-down list of controls to add ToolStripColorPicker
:
VS 2005 uses some sort of reflection to find the ToolStripItem
available to add, but this subject is beyond the scope of this article. ToolStripColorPicker
has the following properties:
/// <summary>
/// Gets or sets the ToolStripColorPickerDisplayType in order to
/// specify the display style of the button
/// - image, text, underline etc.
/// </summary>
public ToolStripColorPickerDisplayType ButtonDisplayStyle;
/// <summary>
/// Gets or sets the color assign to the color picker control.
/// </summary>
public Color Color;
/// <summary>
/// Gets or sets value indicating whether
/// to render the color name to the tool tip text.
/// </summary>
public bool AddColorNameToToolTip;
/// <summary>
/// Gets or sets the text that appears as a tooltip in the button.
/// the color name will be rendered to the tooltip
/// if the AddColorNameToolTip property set to true.
/// </summary>
new public string ToolTipText;
The ButtonDisplayStyle
property, unlike the DisplayStyle
one, is used in order to specify whether to paint the image, the text and the underline for the button instead of just the image and the text, as in DisplayStyle
.
Events
As mentioned above, all of these controls have the SelectedColorChanged
event. This event occurs when the selected color of the control changes. To use this event:
...
// Attach the event
this.colorPickerControl.SelectedColorChanged +=
new System.EventHandler(colorPickerControl_SelectedColorChanged);
...
// Handle the event
private void (colorPickerControl_SelectedColorChanged);
(object sender, EventArgs e)
{
Color newColor = colorPickerControl.Color;
// Do anything you want with the newColor
...
}
Points of interest
To allow context menu behavior, I’ve created a ContextMenuForm
class that derives from System.Windows.Forms.Form
. This form may hold any Control
instance and will hide itself when it loses focus. To use this form:
// Create new instance of the form
OfficePickers.Util.ContextMenuForm contextMenuForm =
new OfficePickers.Util.ContextMenuForm();
// Adds a control to the form (Dock will set to Dock.Fill automatically)
contextMenuForm.SetContainingControl(control);
// Shows the form as a pop-up
contextMenuForm.Show(this, new Point(0, 0), 100);
You can use this form for any control you wish. To close the form — i.e. the user selects an option — use the following code in your control:
Form parentForm = this.FindForm();
if(parentForm != null)
{
parentForm.Hide();
}
can g
g https://tinyurl.com/rsacwgxy
http://tinyurl.com/cbd-oil-that-works-2020
tinyurl.com
tinyurl.com
cbd oil that works 2020
Enedina Renzulli
best website to buy viagra uk
cbd hemp oil
Crimsafe
Tractor Workshop Manuals
directory
cbd e liquid sale
cbd for sale portland
John Deere Diagnostic and Test Manuals
cbd dog treats for airplane
cbd oil for dogs sacramento
dog anxiety cbd
cbd capsules las vegas
visit site
check out the post right here
Google
Google
Delmer Compean
situs judi bola Bwinbet365
slot online
musafirdigital
pokerpelangi
dingdong togel daftar
deposit poker pulsa
judi poker pulsa
dingdong togel
togel wap
dingdongtogel
deposit pulsa joker123
dingdong togel
wap togel
dingdong casino online
Wilbur Vandelaare
139.180.185.166
PUBG Mobile for Windows
66.42.58.199
Sbobet777
situs bet88
totobet sgp
totobet hongkong
togel online
login totobet
togel
Sertifikat SMK3
ISO SMK3
Konsultan SMK3
Reza Lukmana
free ebooks to download and read
sbobet777
kaldu bubuk
soi cau mb hom nay 188loto
188loto
trang lo de k8loto
du doan xo so mien bac 188xoso
trang soi cau tong hop 188xoso
danh de online uy tin 188xoso
soi cau mien bac hom nay tai thethaobet
du doan xsmb chinh xac tai k8loto
download joker123 apk
Judi Slot Online Terpercaya
Daftar Situs Judi Slot Online Terbaik
Agen Judi Slot Pulsa Online
aplikasi joker123
download poker88
idn poker 88
that guy
login joker123
joker apk
Situs Judi Poker Online
manfaat menaruh bawang putih dibawah bantal tidur
joker123 apk
poker88 daftar
joker apk
cara membuat blog
Bandar togel Online
mybest poker
download poker88
idn poker asia 88
poker idn 88
apk idn poker
agen bola
Mobil bekas jakarta selatan
Artikel kesehatan
cara import barang china
rumus lightroom
cover lagu
RekomenQQ
jagadpoker
kayak storage ideas garage
daftar dingdongtogel
togel dingdong
dingdong togel daftar
dingdong togel
dingdong togel
daftar dingdong togel casino
Harga Promo
KelasJudi
s128apk
s12888
download s128
https://www.bwinkasino.com/
s128 asia
s128
sabung ayam online
s12888
king s128 sabung ayam
Capsa Susun
Permainan Online
Bandar66 Online
pokerqq
Idn Poker Play
Asia88 Slot
Sbobet365
Sbobet777 Indonesia
Sbobet999 Slot
Sbobet88
s1288
s12888
Bet88 Online
jagos128
sabung ayam online s128
s1288
s128h com
Situs Bandarq
Themeforia Provide cheap Elementor Pro
good cheap face masks
Judi Bandarqq
Situs Judi Online
Slot Online
Judi Bandarq
Casino online
Situs Judi Casino
BandarQQ
Prediksi Togel Terlengkap
Prediksi Togel SGP
http://180.215.15.98
http://senangdominopkv.com/
http://senangdomino.in/
senang domino
s128 sabung ayam
sabung ayam s128
download s128
s128apk
website hosting companies
game slot online
judi slot online
cara daftar sv388
alternatif login totobet
login totobet
slot deposit pulsa
alternatif login totobet
slot deposit pulsa 10rb
cara daftar totobet
daftar totobet
Pkv Games
segarqq
judi domino qq
agen bola terpercaya
Judi Poker Online
dominobet asia
situs bandarq online
doktercash.com
88csn
21naga
i loved this
solusiponsel
rezgamer
https://webdewaqq.com/
Ulatmovie
https://eclecticcafe.org/
dominobetqq
kamera4d
sosbobet.cc
elevenconsignment
Kursus Bahasa Inggris Batam
download free ebooks online
rezgamer.com
online togel
totobet login
totobet hk
dindong casino
m11hkb.net
kamera4d
sabung ayam s128
s1281
resep masakanku
susupoker
indodewa99
QQ77Bet
Agen Judi Joinpoker.com
mystargarden.com
togel dingdong
joker888.net
vivoslot.net
joker123
joker388.net
joker188.net
s128
joker123.net
you could check here
sbobet88
slotonline.com
judionline
pragmatic play slot
idnpoker
judionline.com
idn poker88
fafaslot
sv388
Kertas puyer
joker123.net
joker slot
joker123.net
joker123
joker 123
joker123 slot
slot joker123 online
joker123 slot
jokerslot
slot online joker123
joker123 slot
WongQQ
BaliQQ
Samsung Printer
printer reviews
Canon Printer
khazanahpromosi
Furniture Jepara
baca selengkapnya
Sofa Sudut L
halaman ini
Lemari Hias
cheap flights tickets
Sallyponchak.com
https://ponseloka.com
https://www.aplikasidewasa.com
https://sahabatqq.mobi/
https://damandiri.com/
Pokerpelangi
levidio.musafirdigital
https://thompson2009.com/
https://charlesforboston.com/
dominoqqmu.com
agen joker388
joker 888
agen joker123
sbobet mobile
install joker123 apk
joker123 apk
joker123 link
jokerwin 123 login
sbobet bola
sbobet daftar
daftar sbobet88
안전사이트
read this
Google
http://103.194.171.205/
http://107.152.32.187/
https://hermes21.net/
https://www.masterhoki.com
i was reading this
https://hermes21.net/
http://103.194.171.205/
http://107.152.32.187/
cock sucking phone sex
go to this site
Abigayle Krause
Google
trik VPN
https://157.245.145.0
mpocasino
free v2ray
https://165.22.245.200
contoh surat
sejarah perang
Printable Worksheets
poker online
99dewa
Cara Hidroponik
daftar slot
agen judi online
judi online
s1288
daftar akun sabung ayam online
daftar sabung ayam online
login joker123
카지노 사이트
casino online
cheap houses for rent by owner
Cara Transfer
privately owned homes for rent
houses for rent near me private landlord
media islam indonesia
wshhmobile
http://202.182.119.182/
Sistem Pemerintahan Indonesia
biaya kuliah
www.qqgalaxyus.com
waheedbaly.com
java388
http://45.76.157.60/
john zink
jualfollowersmurah
https://www.oregonwave.org/
live result togel
situs judi online
PULSA PAYPAL
daftar agen pulsa murah
electric chain hoist
Cara cek nomer smartfren
webbing sling
daftar harga agen pulsa termurah
service iphone mati
mesin mati xiaomi
webbing sling
daftar agen pulsa resmi
Learnerships 2021
form daftar idn poker
daftar agen pulsa online
bandarq
situs poker online
langitqq
pkv games
dominoqq
situs judi online
langitqq
daftar joker123
situs poker online
situs judi
slot deposit pulsa
judi dominoqq
situs pkv games
bandarqq
idn live
situs judi qq
situs poker online
Judi Slot Online
judi online
motorcycle accident lawyer
doacasino
judisbo
doatogel
qbesar
qbesar
poker deposit pulsa
situs judi pulsa
sv388 apk
bandar judi casino online
slot joker123
download apk sv388
joker123
slot online terpercaya
lose weight fast
idn poker com
Desain Rumah Minimalis Modern
s128
download sv388 sabung ayam
sv388 online
s128 daftar
login sv388
joker slot
aplikasi s128
s128 online
s128 online
download apk s128
john yu
888bola
Judi Bandarqq
harga suzuki ertiga
Situs Judi Bandarqq
istanaqq
Situs Judi Bandarqq
Bandarqq
slot deposit pulsa
joker123 casino
login sv388
daftar sbobet88
sbobet indonesia
sbobet indonesia
sabung ayam online terpercaya
agen sabung ayam
login sbobet 88
john zack
deposit slot pulsa
situs slot online terbaru
situs slot online terbaik
daftar slot online
idnplay
poker idn
idn play poker
idn poker
poker online idn
login disini
idnpoker login
bukumasakan.com
white charcoal indonesia
pkv games terpercaya
arespedia.com
idnplay login
http://195.154.113.104
biaya balik nama mobil
rentalmobil.info
copy trade terbaik
zadulqq
TukangKataKata.com
gomunime
john xxiii
Terimaqq
Maxbet Falmouthheritagewalks
situs judi online terbaik
alternatif terimaqq
Login terimaqq
Situs Judi Bola Online
situs judi poker
togel singapore
simpatiqq
film online 05
togel singapore
Judi Bola online terpercaya
Bunda
agen dominoqq terpercaya
judi online terpercaya
parenting website
john young
domino poker online
judi domino online
judi online terpercaya
domino poker online
jambitoto
klinik kulit kelamin
macauslot188
penyakit kulit
klinik kelamin
anak senja
katalog promo
judi online
judi online
300 situs poker
pkv
situs casino online
situs judi terpercaya
judi poker bandarq
situs judi online terpercaya
agen bola
situs poker online
agen sbobet terpercaya
judi bola terpercaya
john zaharra
s1288
joker388
sv388.net
joker 123
joker 388
sbobet com
sbobet.com
Agen Judi Online
Judi Poker Online
idn poker
idn poker 88
john zink
poker88
joker123 daftar
poker88
login joker123
dog with allergy to cbd oil
slot pulsa
slot depo via pulsa tanpa potongan
agen sbobet bola
mobile sbobet
judi depsoit pulsa
slot pulsa
Bali backpacking
idnpoker
www.sbobet.com
Judi Bandarqq
fafa slot
cara membuat tabel
Situs Judi Bandarqq
Situs Judi Bandarqq
garden umbrella
idnplay login
apk idn poker
cbd for pain
poker 88
download apk idn poker
indplay
link login poker88
idnplay download
john zerzan
download apk joker123
slot online
agent sv388
sv388 daftar
agen vivoslot
daftar sabung ayam sv288
agen sv388
slot deposit pulsa
slot depo via pulsa tanpa potongan
judi depsoit pulsa
jual gudang surabaya
https://www.88agen.net
Dominoqq Online
judi bola
Daftar Judi Online Terpercaya
daftar idn poker
situs judi pkv terbaik
babapoker
babapoker
Cek resi
slot online terpercaya
download lagu
situs poker online
vivoslot
vivoslot net
download apk vivoslot
download aplikasi vivoslot
vivoslot apk
agen vivoslot
daftar akun vivoslot
link vivoslot
mpo slot online terbaru
cara daftar idn poker
daftar idn poker
daftar slot deposit pulsa
john zerzan
daftar joker123
Rumah Syariah Malang
daftar joker123 deposit pulsa
Peluang usaha kuliner
joker123
joker123 slot
john xu
slotjoker
situs slot online indonesia
idnpoker
joker 123
idn poker
idnpoker88
joker 123
jokerslot
joker 123 slot
slot online joker123
joker123 net
slot joker123
idnplay poker
joker 123
vivoslot online
slot vivo
vivoslot net
vivoslot
vivoslot
john yoon
slot online
vivoslot.net
sv388 casino
sv388 sabung ayam
sv388 casino
idn poker 88
sv3888
sv388
pulsa 5000
poker pulsa 5000
judi deposit pulsa 5000
sbobet888.com
sbobet88
sv388.com
download apk vivoslot
agen slot vivoslot
daftar slot vivoslot
vivoslot
link vivoslot
aplikasi vivoslot
download pkv poker
daftar pkv poker88
pkv games
joker 388
login ratu poker88
pkv poker88
poker idn
idn live
download idnplay poker
live chat idn poker online
idnpoker
slot vivo
vivo slot
vivoslot
apk idn poker 88
download idn poker
idn poker 88
daftar akun joker123
agen joker123
daftar slot joker123
joker123apk
aplikasi joker123
download joker 123 apk
vivoslot net
vivoslot.net
slot online
login vivoslot
download aplikasi joker 123
login vivo slot
download vivoslot apk
daftar vivoslot
aplikasi vivoslot
agen vivoslot
vivoslot
slot deposit pulsa 5000
judi slot deposit pulsa 5000 tanpa potongan
judi pulsa
togel deposit pulsa 5000
judi online deposit pulsa
john yardley
idn poker
akun idn poker
situs idn poker
situs idn poker
togel wap hk
dingdongtogel
daftar dingdong togel casino
aplikasi dingdongtogel
dingdong casino
dingdong 34d
totobet hk sgp
togel online indonesia
totobet singapura