Hi Dean,
once i wrote something like that, but this code is
C#, you can easily convert it to VB.NET. Sorry
Dude, i dont have VB.NET here yet, just C# and
VC.NET,...
Usage: You call "SetTextChangeHandlers()" at the end of
your class constructor and it will assignt to every textbox it
can find in the form the event handler so you dont have to
set code for any textchange event again and again. It makes
the background of a textbox red when it has no text and white
when you fill some text into it,...
//------------------CODE------------------
private void SetTextChangeHandlers() {
foreach (Control c in this.Controls)
{
try
{
if (c.GetType() == typeof(TextBox))
{
c.TextChanged += new EventHandler(c_TextChanged);
}
}
catch (Exception)
{
}
}
}
void c_TextChanged(object sender, EventArgs e)
{
TextBox t = ((TextBox)sender);
if (t.Text.Length == 0)
{
t.BackColor = Color.Red;
}
else
{
t.BackColor = Color.White;
}
}
//------------------CODE END------------------
This solution is fast, save and does not need
a lot of code,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space:
http://kerem-g.spaces.live.com/
Latest Open-Source Projects:
http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."