0
我有一個datagridview有3列(數量,scraft因素,執行數量)。我想要的是,如果用戶在qty中編碼50,在scraf中編碼爲2,實際上qty將根據qty乘以2自動計算。我正在使用keyup事件。現在我正在使用endingit來獲取當前行和列的當前值,現在的問題是如果要編碼的數量超過一個數字,它將因爲結束而不會接受。我必須使用哪個事件?或者這個場景的任何解決方案。請參閱下面的代碼vb.net keyup事件
在此先感謝。
蒂爾索
Private Sub tbx_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
dgvIngredient.EndEdit()
Dim intCurrentRow As Integer = dgvIngredient.CurrentRow.Index
Dim decQuantity As Decimal
Dim decScrafFactor As Decimal
Dim decActuallQty As Decimal
decQuantity = dgvIngredient.Item(2, intCurrentRow).Value
decScrafFactor = dgvIngredient.Item(3, intCurrentRow).Value
decActuallQty = decQuantity * decScrafFactor
dgvIngredient.Item(4, intCurrentRow).Value = decActuallQty
End Sub