C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » Visual Studio »

How to access ProfessionalColors Class in Csharp (with cute example)


Posted Date: 30 Aug 2009    Resource Type: Articles    Category: Visual Studio
Author: VeerabaguMember Level: Gold    
Rating: 1 out of 5Points: 12



How to access ProfessionalColors Class in Csharp (with cute example)



What is professionalcolor class

Provides Color structures that are colors of a Windows display element.
this class cannot inherited.


How to change the color of menustrip control if i click changecolor button


private void Form1_Load(object sender, EventArgs e)
{
button1.Click += new EventHandler(ChangeColors_Click);
}

void ChangeColors_Click(object sender, EventArgs e)
{
ToolStripManager.Renderer =
new ToolStripProfessionalRenderer(new MyProfessionalColors());
}


private void button1_Click(object sender, EventArgs e)
{
// Create a control called ToolStrip.
ToolStrip ts = new ToolStrip();
ts.Items.Add("Veera");
ts.Items.Add("Siju");
ts.Items.Add("Rahul Manikam");
// i am adding the toolstrip into form
this.Controls.Add(ts);
}

class MyProfessionalColors : ProfessionalColorTable
{
public override Color ToolStripGradientBegin
{ get { return Color.GreenYellow; } }

public override Color ToolStripGradientMiddle
{ get { return Color.CadetBlue; } }

public override Color ToolStripGradientEnd
{ get { return Color.CornflowerBlue; } }
}


Description

First in form load i am appending the event called void ChangeColors_Click in button then if i click button i am that appended event that event

automatically called the class myprofessionalcolors. that class provide the color to toolstrip

Very nice class to presenting our form with colorful please execute and use it in your form

please see the attached colorful form

Attachments






Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
How to access ProfessionalColors Class in Csharp (with cute example)  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: ProgressBar Class Usage for newbie
Previous Resource: How to filter happening in open file dialog (for beginners)
Return to Discussion Resource Index
Post New Resource
Category: Visual Studio


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use