请VB高手解详细解释一下这句代码的含义

来源:百度知道 编辑:UC知道 时间:2024/06/06 14:25:54
If Not IsNull(DataGrid1.Bookmark) Then
If Trim(DataGrid1.Columns("房号").CellText(DataGrid1.Bookmark)) = "" Then
MsgBox "房号不能为空!", vbOKOnly + vbExclamation, ""
其中:Not IsNull(DataGrid1.Bookmark) 是什么意思
If Trim(DataGrid1.Columns("房号")是什么意思
.CellText(DataGrid1.Bookmark)) 是什么意思

Not IsNull(DataGrid1.Bookmark)是DataGrid1.Bookmark不为空,IsNull是判断是否为空的函数。
If Trim(DataGrid1.Columns("房号")这句没完,整句话是先清除DataGrid1.Columns("房号").CellText(DataGrid1.Bookmark)左右空格后判断里面的内容,Trim是清除左右空格的函数。
.CellText(DataGrid1.Bookmark))是Columns的子属性,这是半句话。