鼠標移動時讓數據窗口中當前鼠標下的數據行改變顏色

編程步驟如下:
1、定義窗口實例變量:
String is_OldColor
2、在數據窗口的Constructor事件中編寫如下腳本:
is_OldColor = This.Describe("datawindow.detail.color")
3、爲數據窗口定義一個自定義事件,事件名稱叫什麼並不重要,關鍵要映射pbm_MouseMove事件。然後在該自定義事件上編寫如下腳本:
string ls_dwoname
string ls_temp

ls_dwoname=GetObjectAtPointer()
This.Modify("row_t.text='0'")
ls_temp = Mid(ls_dwoname,Pos(ls_dwoname,'~t') + 1)
if integer(ls_temp) > 0 then&
This.Modify("row_t.text='" + ls_temp + "'")

This.Modify("datawindow.detail.color='0~tif(getrow()=" + ls_temp + ",rgb(25,200,240)," + is_OldColor + ")'")

 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章