看板 Visual_Basic 關於我們 聯絡資訊
我設計了一個表單, 是提供使用者輸入一些設定用的。 但是出現了一個奇怪的BUG。 只要表單開啟之後關閉, 所有的設定就會重置變成預設值@@" 把他分成幾種狀況:(假設設定表單上,原本text1=200) 1. 開啟設定表單, 將text1改為 100, 關閉設定表單, 執行form1上的命令扭, 跑出text1=200時的數據。 2. 開啟設定表單, 將text1改為 100, 不將表單關閉, 執行form1上的命令扭, 跑出text1=100時的數據。 3. 開啟設定表單, 將text1改為 100, 不將設定表單關閉, 執行form1上的儲存設定, 關閉程式、重開程式, 載入剛剛儲存的設定, 直接跑form1上的命令扭, 跑出text1=100時的數據。 之後打開設定表單, 會發現text1=100, 但是關閉設定表單, 再跑一次form1上的命令扭, 又變回text1=200時的數據..... 總之,只要關閉過設定表單, 設定就會被重置.... 搞不懂問題在哪....囧 -- "Every kid who has dreamed of being a baseball player has stood in his front yard with a bat and said to himself, "Bottom of the ninth, Game 7 of the World Series, the bases are loaded," and then envisioned hitting a home run to win the game. My job is to shatter that dream." By Huston Street -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 124.8.72.164
nobody1:值在表單讀取時都會始化 所以值要另外放或傳值進去 03/26 11:39