Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2007, 08:58 AM
Authorized User
 
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saidan Send a message via Yahoo to saidan
Default form back color;

hi all

this is the first post of me in this forum and hop to get an information about the things which i'm searching 4;

i'm trying to pass a color code to a windows form in c#;

but as i understood that the forms are not accepting the color code directly, i'm not sure it might accept it;

..:)

toward a success civelization;
__________________
================================================
toward a success civelization;
 
Old October 26th, 2007, 09:17 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Are you just looking for the BackColor property?

/- Sam Judson : Wrox Technical Editor -/
 
Old October 26th, 2007, 10:18 PM
Authorized User
 
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saidan Send a message via Yahoo to saidan
Default

;;

i'm trying to use trackbar to change the background color of the for;

if the user moved the trackbar slider the color form should change;

this id the idea;

..:)

toward a success civelization;
 
Old October 27th, 2007, 04:28 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Good for you.

What exactly is your problem?

/- Sam Judson : Wrox Technical Editor -/
 
Old October 27th, 2007, 07:23 AM
Authorized User
 
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saidan Send a message via Yahoo to saidan
Default

My Question is:
How to Use The Color Code To Change The Color Of the Form?


I hope The Question Cleared Now..

:)

toward a success civelization;
 
Old October 27th, 2007, 02:06 PM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

What color code?

You set the background color like this:

this.BackColor = Color.Blue;

or

MyForm frmMyForm = new MyForm();
frmMyForm.BackColor = Color.Blue;

/- Sam Judson : Wrox Technical Editor -/
 
Old October 28th, 2007, 12:29 AM
Authorized User
 
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saidan Send a message via Yahoo to saidan
Default

THE COLOR CODE WHICH I'M SPEAKING ABOUT IS THAT WHICH IS IN THIS FORMAT: #293040;

OK LET ME EXPLAIN IN OTHER WAY;

IN THE TRACKBAR, WHEN THE USER MOVE THE SLIDER , THE BACKGROUND COLOR SHUILD CHANGE SMOOTHLY, IN THE ORDER OF COLORS JUST LIKE THE PHOTOSHOP IF YOU HAVE SEEN IT..

DO YOU KNOW ANY OTHER WAY TO DO, BUT I NEED THE COLOR CODE TO BE GENERATED IF YOU WILL USE ANOTHER WAY..

THANKS FOR HELPING :)

toward a success civelization;
 
Old October 28th, 2007, 05:34 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

ok, no need to shout :)

Two ways. Firstly from the hex string, like in this article:
http://www.c-sharpcorner.com/UploadF...HexColors.aspx

Or you can have 3 sliders, red, green and blue, a create it from the Color.FromArgb(red, green, blue) method.

/- Sam Judson : Wrox Technical Editor -/
 
Old October 28th, 2007, 08:53 AM
Authorized User
 
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saidan Send a message via Yahoo to saidan
Default

>>

Sorry Dear, Just Caps Lock was enabled when i wrote that reply..

anyway i'll try the ways which you refered to and i'll let you know if the work has done or not..

thanks again and sorry 4 disturb

:)

================================================
toward a success civelization;
 
Old October 28th, 2007, 08:29 PM
Authorized User
 
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saidan Send a message via Yahoo to saidan
Default

good morning;

i've done the way of the three trackbars, and now i'm facing a problem in conversion from integer to hexadecimal and vise versa;

do i have to declare a new class or there are already ready made one to do..

::)

================================================
toward a success civelization;





Similar Threads
Thread Thread Starter Forum Replies Last Post
change only the first item in array's back color i remya1000 .NET Framework 1.x 1 November 5th, 2007 10:43 PM
back color of cell of datagrid [email protected] VB.NET 1 November 18th, 2006 03:28 AM
DataGrid row back color related to datalist id's jgd ASP.NET 2.0 Basics 0 May 4th, 2006 09:21 AM
How to change the back color of toolbat allenfei BOOK: Professional C#, 2nd and 3rd Editions 3 August 15th, 2005 02:37 AM
Color Form mivvb VB How-To 8 June 20th, 2005 10:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.