用数据窗口可以实现
方法是:1、先新建一个数据窗口对象d_temp,external,freeform风格,随意设置一列,然后将此列delete.
2、在数据窗口中方置button控键,并在属性对话框中设置font-〉background color 属性设置为transparent,将控件命名为b_butt
3、创建窗口,定义实例变量 string is_old,创建一数据窗口控件dw_temp,并与先前的熟居窗口对象d_temp绑定
4、在数据窗口dw_temp的consturctor事件写 this.insertrow(0)
5、在数据窗口中定义一个用户事件ue_dwnmousemove, event id=pbm_dwnmousemove
script为:
if dwo.type = 'button' and dwo.name <> is_old then
this.modify(is_old + ".color='134217856'")
this.modify(dwo.name+".color='255'")
is_old=dwo.name
elseif dwo.type <> 'button' then
this.modify(is_old+".color='134217856'")
is_old=''
end if
6、数据窗口的clicked事件
choose case dwo.name
case 'b_button'
messagebox("tishi","yi xuan ze le an niu")
......//
......//此处放代码实现多个按钮的功能
end choose