在数据窗口中控制文本框的位置在所选行的下面,如果下面选择的行显示不限,文本框的位置显示在选择行的上面

先定义实例变量 long il_selectrow

在datawindow的rbuttondown事件中写如下代码

 long ll_first_row ,ll_row,ll_detail_height
 long ll_last_row,ll_pos_height
 
 
 string str_band
 str_band=GetBandAtPointer() //得到当前鼠标所指对象所在的带区
 str_band=left(str_band,(pos(str_band,'~t') - 1))//得到"header"、"detail"等

if pos(str_band,"detail")>0 then
    st_5.visible=true
    this.selectrow(0,false)
     this.selectrow(row,true)
    st_5.x= this.x +   pointerX()  + 100
    if this.height - pointerY() > st_5.Height then
        st_5.y=  this.y +  pointerY()  + 50
    else
        st_5.y= this.y +   pointerY()  -  st_5.Height  - 50
    end if    
    il_selectrow=row
else
    
    st_5.visible=false
    this.selectrow(0,false)
    il_selectrow=0
end if

用鼠标滚动时如果选择行不可见,在 scrollvertical写如下代码,可以隐藏文本框

long ll_first_row_onpage
long ll_last_row_onpage
 

ll_first_row_onpage =  long( this.Object.DataWindow.FirstRowOnPage)
ll_last_row_onpage= long( this.Object.DataWindow.LastRowOnPage)

st_1.text="il_selectrow=" +string(il_selectrow)   +  "   ll_first_row_onpage=" + string(ll_first_row_onpage)   + "   ll_last_row_onpage=" +string(ll_last_row_onpage)

if not(il_selectrow>=ll_first_row_onpage  and il_selectrow<=ll_last_row_onpage)  then
    this.selectrow(0,false)
    st_5.visible=false
end if

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值