Я прочитал о Control.ParentChanged Событие на MSDN http://msdn.microsoft.com/en-us/library/system.windows.forms.control.parentchanged(VS.71).aspxКогда происходит событие Control.ParentChanged?
Но я не понимаю, пример кода: нет ParentChanged вообще появляться в исходном коде?
private void currencyTextBox_TextChanged(object sender, EventArgs e)
{
try
{
// Convert the text to a Double and determine if it is a negative number.
if(double.Parse(currencyTextBox.Text) < 0)
{
// If the number is negative, display it in Red.
currencyTextBox.ForeColor = Color.Red;
}
else
{
// If the number is not negative, display it in Black.
currencyTextBox.ForeColor = Color.Black;
}
}
catch
{
// If there is an error, display the text using the system colors.
currencyTextBox.ForeColor = SystemColors.ControlText;
}
}
Поэтому я не понимаю, что такое событие Control.ParentChanged.