这个要学习窗口的遍历与窗口控件的遍历,把对应的实例给找出来,就可以了
之所以要遍历,是因为pb没有办法知道这些内容的句柄,只能通过名称来遍历,当控件的classname()跟你想要的一致时,就返回.例如,要在某窗口找指定名称的文本控件
global type f_find_st from function_object
end type
forward prototypes
global function statictext f_find_st (ref window aw_win, string as_name)
end prototypes
global function statictext f_find_st (ref window aw_win, string as_name);//遍历控件,找到同名的
long i,ll_rc
statictext rn
ll_rc = upperbound(aw_win.control)
for i = 1 to ll_rc
if aw_win.control[i].classname()=as_name then
rn = aw_win.control[i]
exit
end if
next
return rn
end function
那么,在使用时就很简单了
statictext lst_tmp
lst_tmp = f_find_st(w_rep_xxx,'st_shop')
接下来就可以对lst_tmp进行各种操作了