缘由https://bbs.csdn.net/topics/396522344
Public Class VB解答专用窗体
Private Sub VB解答专用窗体_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim 数据列表 = New DataGridView
数据列表.Parent = Me
数据列表.Columns.Add("序列", "序列")
数据列表.Columns.Add("内容", "内容")
数据列表.Rows.Add(5)
AddHandler 数据列表.CellValidating, AddressOf 输入验证
End Sub
Sub 输入验证(sender As Object, e As DataGridViewCellValidatingEventArgs)
If e.FormattedValue = "嗯嗯" Then MessageBox.Show("确定添加?", "友情提示", MessageBoxButtons.YesNo)
End Sub
End Class