hi it is not a big problem.
1. just change the color u want to show once the focus is in the text box
that should written in the MouseEnter Event.
private void txtBox_MouseEnter(object sender, System.EventArgs e)
{
//set the color here. since u want to know the focus can uesd flag
}
2.then set the color once the focus out from the text box in the MouseLeave event
That should be the default color
private void pbUpDown_MouseLeave(object sender, System.EventArgs e)
{
//here sholud set default color
}
I think this is what u want
bi
madushan thilina
The code u have suggested is for each textbox in the form...... i want a bit generalised method ie;without actually writting code for each control.....something dynamic.
i am able to get the no of textboxes on the form(dynamically) and can clear all on a click of a bttn.... but not able to fire another event from an event
This piece of code is what i am using
// Initialization code is designer generated and contained
// in a separate file using the C# 2.0 support for partial
// classes.
InitializeComponent();
}
// The event handler for the button click event.
private void cmdProcessAll_Click(object sender, System.EventArgs e)
{
ProcessControls(this);
}
private void ProcessControls(Control ctrl)
{
// Ignore the control unless it's a textbox.
if (ctrl.GetType() == typeof(TextBox))
{
ctrl.Text = "";
}
// Process controls recursively.
// This is required if controls contain other controls
// (for example, if you use panels, group boxes, or other
// container controls).
foreach (Control ctrlChild in ctrl.Controls)
{
ProcessControls(ctrlChild);
}
}