删除按钮
Dim dt As Table=Tables("主窗口_table1") '注意这里一定是绑定的副表,如果是tables("业务")那么如果不保存数据将不能删除
Dim rs As List(of Row) = dt.GetCheckedRows
If rs.Count > 0 Then
Dim Result As DialogResult '加一个提示窗口,如果点确认就删除,点否就返回
result= MessageBox.show("您确认要删除吗?","~温馨提示~",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
If result=DialogResult.Yes Then
For Each r As Row In rs
r.Delete
Next
dt.save
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("主表","工作项目|分类|功能主题")
trv.ExpandAll
End If
Else
MessageBox.show("您未选择行,请选择后再点击删除按钮","~温馨提示~",MessageBoxButtons.OK,MessageBoxIcon.Error)
End If