作者 华软 jb99334
当咱们运行PB数据库管理程序时,可能会出现这样的要求,当在一个窗口中向数据库加入一条记录,这时,运用与这个数据库相关下拉式数据窗口的窗口必需刷新其中的下拉式数据窗口。为了到达这个目的,需要给所有的窗口增加一个用户事件——ue_refresh_dddw。然后,给frame增加一个用户事件 ——ue_refresh_all_dddw,当第一个窗口保存数据时,触发事件ue_refresh_all_dddw!
ue_refresh_dddw的代码:
long l_rc
long l_col, l_colcount
string s_temp
datawindowchild dwc
// Get the Total number of columns
s_temp = dw_1.Object.Datawindow.Column.Count
l_colcount = long(s_temp)
// Cycle through all columns looking for datawindow children.
for l_col=1 to l_colcount
s_temp = dw_1.describe('#'+string(l_col)+'.name')
l_rc = dw_1.GetChild(s_temp, dwc)
if l_rc = 1 then
dwc.SetTransObject(SQLCA)
dwc.Retrieve()
end if
next
ue_refresh_all_dddw的代码:
window wSheet
string wName
// Get the First sheet
wSheet = this.GetFirstSheet()
Do While IsValid(wSheet)
// There is an open sheet
wSheet.TriggerEvent('ue_refresh_dddw')
wSheet = this.GetNextSheet(wSheet)
LOOP