主题:新手有段代码看不明白 有段代码看不明白,望高手指点
这是一个函数.中间代码改变列的颜色,可是上下两段代码除了改变新行的状态看不明白有什么意义,这个函数在数据窗口空件的getfocus事件和itemfocuschanged事件中被调用
DWItemStatus status //行状态
if Left(this.Describe(this.GetColumnName() + ".ColType"), 4) = "char" then
if IsNull(this.GetItemString(this.GetRow(), this.GetColumnName())) or this.GetItemString(this.GetRow(), this.GetColumnName()) = "" then
status = this.GetItemStatus(this.GetRow(), 0, Primary!)
this.SetItem(this.GetRow(), this.GetColumnName(), " ")
end if
end if
this.Modify(is_old_column + ".BackGround.Color = " + String(RGB(255, 255, 255)))
this.Modify(this.GetColumnName() + ".BackGround.Color = '" + String(RGB(166, 202, 240)) + "~tif (GetRow() = " + String(this.GetRow()) + ", " + String(RGB(166, 202, 240)) + "," + String(RGB(255, 255,255)) + ")'")
is_old_column = this.GetColumnName()
if Left(this.Describe(this.GetColumnName() + ".ColType"), 4) = "char" then
if this.GetItemString(this.GetRow(), this.GetColumnName()) = " " then
this.SetItem(this.GetRow(), this.GetColumnName(), "")
if status = New! then
this.SetItemStatus(this.GetRow(), 0, Primary!, NotModified!)
end if
end if
end if
this.SelectText(1, 255)