|
Dieser Artikel wurde maschinell übersetzt. Bewegen Sie den Mauszeiger über die Sätze im Artikel, um den Originaltext anzuzeigen. Weitere Informationen
|
Übersetzung
Original
|
Control.OnCursorChanged-Methode
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
protected override void OnTextChanged(System.EventArgs e) { try { // Convert the text to a Double and determine // if it is a negative number. if(double.Parse(this.Text) < 0) { // If the number is negative, display it in Red. this.ForeColor = Color.Red; } else { // If the number is not negative, display it in Black. this.ForeColor = Color.Black; } } catch { // If there is an error, display the // text using the system colors. this.ForeColor = SystemColors.ControlText; } base.OnTextChanged(e); }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.