本文整理汇总了C#中System.Windows.Forms.TextBox.ResetBackColor方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.ResetBackColor方法的具体用法?C# TextBox.ResetBackColor怎么用?C# TextBox.ResetBackColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextBox
的用法示例。
在下文中一共展示了TextBox.ResetBackColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadOnly_BackColor_Set
public void ReadOnly_BackColor_Set ()
{
textBox.BackColor = Color.Blue;
textBox.ReadOnly = true;
Assert.IsTrue (textBox.ReadOnly, "#A1");
Assert.AreEqual (Color.Blue, textBox.BackColor, "#A2");
Form form = new Form ();
form.ShowInTaskbar = false;
form.Controls.Add (textBox);
form.Show ();
Assert.IsTrue (textBox.ReadOnly, "#B1");
Assert.AreEqual (Color.Blue, textBox.BackColor, "#B2");
textBox.ReadOnly = false;
Assert.IsFalse (textBox.ReadOnly, "#C1");
Assert.AreEqual (Color.Blue, textBox.BackColor, "#C2");
textBox.ReadOnly = true;
Assert.IsTrue (textBox.ReadOnly, "#D1");
Assert.AreEqual (Color.Blue, textBox.BackColor, "#D2");
textBox.BackColor = Color.Red;
Assert.IsTrue (textBox.ReadOnly, "#E1");
Assert.AreEqual (Color.Red, textBox.BackColor, "#E2");
textBox.ReadOnly = false;
Assert.IsFalse (textBox.ReadOnly, "#F1");
Assert.AreEqual (Color.Red, textBox.BackColor, "#F2");
textBox.ReadOnly = true;
textBox.ResetBackColor ();
Assert.IsTrue (textBox.ReadOnly, "#G1");
Assert.AreEqual (SystemColors.Control, textBox.BackColor, "#G2");
form.Dispose ();
textBox = new TextBox ();
textBox.ReadOnly = true;
textBox.BackColor = Color.Blue;
Assert.IsTrue (textBox.ReadOnly, "#H1");
Assert.AreEqual (Color.Blue, textBox.BackColor, "#H2");
form = new Form ();
form.ShowInTaskbar = false;
form.Controls.Add (textBox);
form.Show ();
Assert.IsTrue (textBox.ReadOnly, "#I1");
Assert.AreEqual (Color.Blue, textBox.BackColor, "#I2");
textBox.ReadOnly = false;
Assert.IsFalse (textBox.ReadOnly, "#J1");
Assert.AreEqual (Color.Blue, textBox.BackColor, "#J2");
textBox.ResetBackColor ();
Assert.IsFalse (textBox.ReadOnly, "#K1");
Assert.AreEqual (SystemColors.Window, textBox.BackColor, "#K2");
form.Close ();
}