Class & Instance 基礎觀念....
/// <summary>
/// 範例2: 2個引用變數,使用同一個實例(instance),同一個對象。像 ref
/// </summary>
private static void test2()
{
Form myForm1;
Form myForm2;
myForm1 = new Form();
myForm2 = myForm1;
myForm1.Text = "It is test";
myForm2.Text = "I changed it";
myForm1.ShowDialog();
}
沒有留言:
張貼留言