- 最後登錄
- 2023-4-9
- 在線時間
- 0 小時
- 註冊時間
- 2007-7-16
- 閱讀權限
- 20
- 精華
- 0
- UID
- 1820716
- 帖子
- 177
- 積分
- 6 點
- 潛水值
- 7641 米
| 各位大大好:
我有一個winform 出貨單, 其中有個TextBox是廠商代號, 我想要在這個欄位中如輸入"?"問號(使用KeyPress), 則會跳出搜尋廠商的對話框, 找到資料後, 關閉對話框, 把找到的廠商代號填入原表單的TextBox中, 但不知為何, TextBox都會出現一個"?"號, 我有試過用其他字元, 也都會有這種狀況, 請問有那位大大知道如何解決嗎?
- private void txtSupplierNumber_KeyPress(object sender, KeyPressEventArgs e)
- {
- //捕捉?號
- if (e.KeyChar == '?')
- {
- GetSupplierData();
- }
- }
複製代碼- private void GetSupplierData()
- {
- frmQrySupplier frm = new UI.frmQrySupplier();
- //問啟搜尋廠商資料對話框
- if (frm.ShowDialog() == DialogResult.OK)
- {
- Supplier supplier = SupplierBLL.GetById(frm.SearchId);
- if (supplier != null)
- {
- //如果找到資料, 則將廠商代碼,名稱,地址輸入到各欄位
- lblSupplierName.Text = supplier.Name;
- txtShipAddress.Text = supplier.Address;
- txtSupplierNumber.Text = supplier.Number;
- }
- }
- }
複製代碼
找到資料後, 結果txtSupplierNumber這個TextBox就是會多一個問號
... |
附件: 你需要登錄才可以下載或查看附件。沒有帳號?註冊 |