看了一下楼主的代码,主要问题出在 oleList1.ItemCheck 上。当单击 CheckBox 时,被单击的节点并不会成为当前选定节点,即:Selected = .f.,修改后的oleList1.ItemCheck代码如下:
LPARAMETERS item
item.selected = .t.
&& 使被单击的节点成为选定节点
*!*
FOR i = 1 TO this.ListItems.Count
*!*
IF this.ListItems(i).Checked = .T.
*!*
this.ListItems(i).Selected = .t.
*!*
ENDIF
*!*
IF this.ListItems(i).Checked = .f.
*!*
this.ListItems(i).Selected = .f.
*!*
ENDIF
*!*
ENDFOR
IF this.selectedItem.Selected = .t.
this.ListItems(this.selectedItem.Index).Checked = .t.
FOR i = 1 TO this.ListItems.Count
IF i != this.selectedItem.Index
this.ListItems(i).Checked = .f.
ENDIF
ENDFOR
ENDIF
IF this.ListItems(this.selectedItem.Index).Checked = .f.
this.ListItems(this.selectedItem.Index).Checked = .t.
this.ListItems(this.selectedItem.Index).Selected = .t.
ENDIF