|
我现在做了一个calculator,全部value会add在grid里面。但是现在当我每add一次value进grid,它并不会自动add
在new row,而是会replace旧的value。以下是我的code。请教一下怎么solve以下的code。
If txt_height.Text = "" Or txt_width.Text = "" Or txt_height.Text = "." Or txt_width.Text = "." Or txt_quantity.Text = "" Then
grid_total.TextMatrix(1, 0) = ""
grid_total.TextMatrix(1, 1) = ""
grid_total.TextMatrix(1, 2) = ""
grid_total.TextMatrix(1, 3) = ""
Else
Dim X As Integer
X = 1
grid_total.Rows = grid_total.Rows + 1
grid_total.TextMatrix(X, 0) = txt_width.Text + Space(1) + list_dimen.Text + Space(1) + "x" + Space(1) + txt_height.Text + Space(1) + list_height.Text
grid_total.TextMatrix(X, 1) = txt_quantity.Text
grid_total.TextMatrix(X, 2) = list_price.Text
grid_total.TextMatrix(X, 3) = txt_total.Text
End If |
|