我讀到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事件是或沒有。