2014-09-12 21 views

回答

1

的簡單地回答是聲明字符串作爲Form1的公共靜態這樣:

public class Form1 
{ 
    public static string TheString = "Test"; 
} 

然後從Form2訪問它:

MessageBox.Show(Form1.TheString); 
+0

感謝羅布,我不得不玩了一下,但我得到了我的答案。 – 2014-09-12 16:09:57

相關問題