可能重複:從主窗體
Passing variables from main form to input form
Passing data between forms從主要形式傳遞布爾
我將如何傳遞一個布爾函數的結果?基本上是檢查用戶是否有權編輯程序中的任何內容?我基本上想檢查任何處理編輯事件的布爾值。有任何想法嗎?謝謝。
可能重複:從主窗體
Passing variables from main form to input form
Passing data between forms從主要形式傳遞布爾
我將如何傳遞一個布爾函數的結果?基本上是檢查用戶是否有權編輯程序中的任何內容?我基本上想檢查任何處理編輯事件的布爾值。有任何想法嗎?謝謝。
創建於FormOptions一個屬性(或方法),說GetMyResult:
using (FormOptions formOptions = new FormOptions())
{
formOptions.ShowDialog();
string result = formOptions.GetMyResult;
// do what ever with result...
}
所以,像'Form'的財產? – Jodrell
http://stackoverflow.com/questions/1433182/passing-variables-from-main-form-to-input-form?rq=1你」 – Adam