|
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
|
|
|
October 26th, 2007, 08:58 AM
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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;
|
October 26th, 2007, 09:17 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Are you just looking for the BackColor property?
/- Sam Judson : Wrox Technical Editor -/
|
October 26th, 2007, 10:18 PM
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
;;
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;
|
October 27th, 2007, 04:28 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
Good for you.
What exactly is your problem?
/- Sam Judson : Wrox Technical Editor -/
|
October 27th, 2007, 07:23 AM
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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;
|
October 27th, 2007, 02:06 PM
|
|
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
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 -/
|
October 28th, 2007, 12:29 AM
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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;
|
October 28th, 2007, 05:34 AM
|
|
Friend of Wrox
|
|
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
|
|
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 -/
|
October 28th, 2007, 08:53 AM
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
>>
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;
|
October 28th, 2007, 08:29 PM
|
Authorized User
|
|
Join Date: Oct 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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;
|
|
|