在窗口设一按钮比如命名为“重新设置”,代码:
Dim Val As String = e.Form.Controls("TextBox1").Value if IsNumeric(Val) Then SaveConfigValue("Any",Val) Else MessageBox.Show(Val & "值不是数值型,不给予保存!","提示",MessageBoxButtons.Ok,MessageBoxIcon.Information) End If
窗口AfterLoad事件代码:
e.Form.Controls("TextBox1").Value = GetConfigValue("Any","")
然后在DataColChanged事件中设置代码:
Dim dr As DataRow = e.DataRow if e.DataCol.Name = "第一列" OrElse e.DataCol.Name = "第二列" Then dr("结果") = dr("第一列") + dr("第二列") * GetConfigValue("Any","") End If
|