Header Ads

Header Ads

How to use color dialog in c sharp Application

How to use color dialog box in c sharp application

First you create new application and put richtextbox and button in the form and then double click on button
and right following code
you can use back color and for-color property of  richtextbox or textboxcontrol and  other control..
1)First we work on control back color to change our control back color you right following code in button click event
Colordialog cs=new Colordialog();
cs.Showdialog();
Richtextbox1.BackColor=cs.Color;
This Code Change the backcolor of Control
2) we work on control for color  to change our control for color you right following code in button click event
 Colordialog cs=new Colordialog();
cs.Showdialog();
Richtextbox1.ForeColor=cs.Color;
This Code Change the For Color of Control

No comments:

Powered by Blogger.