Register for your free account! | Forgot your password?

You last visited: Today at 01:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



color

Discussion on color within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
color

Ive used this code for textbox, but it dont change the color to new color.
When it changed once, then it can't change again.
Anyone got a solution?
Code:
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            if (textBox1.Text == "Red")
            {
                textBox1.ForeColor = Color.Red;
            }
            if (textBox1.Text == " Blue")
            {
                textBox1.ForeColor = Color.Blue;
            }
        }
xStylo is offline  
Old 06/15/2010, 18:51   #2
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Code:
            if (textBox1.Text == "Red")
            {
                textBox1.ForeColor = Color.Red;
            }
            if (textBox1.Text == " Blue")
            {
                textBox1.ForeColor = Color.Blue;
            }
change to
Code:
            if (textBox1.Text == "Red")
            {
                textBox1.ForeColor = Color.Red;
            }
            if (textBox1.Text == "Blue")
            {
                textBox1.ForeColor = Color.Blue;
            }
Next time check for extra spaces that you might add by mistake before starting a new thread..
Nullable is offline  
Thanks
1 User
Old 06/15/2010, 19:19   #3
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
It was supposed to change color when i write Blue after Red.
But it don't do.
I have to remove all text and write Blue.
Any clue?
xStylo is offline  
Old 06/16/2010, 17:19   #4
 
elite*gold: 0
Join Date: Oct 2009
Posts: 128
Received Thanks: 50
Quote:
Originally Posted by xStylo View Post
It was supposed to change color when i write Blue after Red.
But it don't do.
I have to remove all text and write Blue.
Any clue?
This is a general C# programming question that has nothing to do with CO2.

In the future, you should provide detailed instructions on what you're trying to accomplish before we waste our time solving your simple problems which could have been fixed by searching Google for certain keywords.

You should have known that the equality operator used on a string tests the entire contents of that string, so of course you won't get blue text if you're looking for the text they wrote after everything else. You need to start from the beginning, and learn C# again, IMHO.

If you want to test is a string ends with another string, then take a look at the for a possible solution to your problem.
s.bat is offline  
Thanks
1 User
Old 06/16/2010, 19:07   #5
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
I never worked alot with forms application.
Most console and xml.
xStylo is offline  
Old 06/18/2010, 08:29   #6
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
Just do

Code:
public void GetColor()
{	
	if (textBox1.Text == "Red")
	{
		textBox1.ForeColor = Color.Red;
	}
	else if (textBox1.Text == "Red Blue")
	{
		textBox1.ForeColor = Color.Blue;
	}
}
Then just add an event for TextChanged or w/e on that text box event panel
And then inside that just do
GetColor();

should work
Ian* is offline  
Reply


Similar Threads Similar Threads
Horse Color (This Program Tells You Your Horse's EXACT Color Values)
10/21/2009 - CO2 Exploits, Hacks & Tools - 35 Replies
CURRENTLY: WORKING (Patch 5157) Alright guys, finally got around to updating and fixing this program... the way it works now is, just run the program, equip the horse you want to look at, and it'll show you it's Color Stats... in future versions I will be making it so u can equip one horse, then another, and it'll tell you what each horse's value is AND what would be the result if u combined them... and maybe even a little further into the future I will release a program that'll allow you to...
WoW Color Hack (Use color-codes in text)
09/23/2007 - WoW Exploits, Hacks, Tools & Macros - 31 Replies
WoWColorHack.flt -=Preamble=- I'm quite surprised that no one has released anything similar yet - the theory behind this dates back to the alpha days. Hell, I first used this filter on my own alpha sandbox. -=Theory=-



All times are GMT +1. The time now is 01:15.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.