Heyah
Does anyone know how can I change the bacground color of my textfield by using :
the commands if & else
It's for one of my school assignments but I really can't get to solve it by myself i searched through web but nothing :S
We must use the
textBox1.BackColor = System.Drawing.Color.Black;
&
if (textBox1.BackColor.Equals(System.Drawing.Color.Black))
lines but from what you can see in my way of writing and asking for so (I suppose) simple question I'm pretty new to coding so any help or tips would be appreciated
my assignment is to
create a button and a textfield in Visual Studio 2008
and make the colour of the textfield change whenever i press the button
(while the color is red and i press the buttong the color haves to change to green then again to yellow, blue and so on)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace opdracht2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
textBox1.BackColor = System.Drawing.Color.Red;
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.BackColor.Equals(System.Drawing.Color.Red))
{
}
}
}
}
sorry for my bad english and thanks