当前位置:K88软件开发文章中心编程全书编程全书01 → 文章内容

PB中用回车键代替TAB键

减小字体 增大字体 作者:佚名  来源:翔宇亭IT乐园  发布时间:2019-1-3 0:17:40

:2010-03-25 08:32:00

如何在PB中用回车键来代替TAB键呢,下面给出了一个较简单的实现源代码。

//在数据窗口当中按下回车键之后,焦点移动到后面的字段,如从最后移动,则自动跳转到下一行
send(handle(this),256,9,long(0,0))

//窗口当中的enter事件!在datawindow的事件当中新建一个自定义事件ue_enter,在even_id当中paste"pbm_dwnprocessenter"
long      ll_row,ll_RowCount
integer li_col,li_colcount
li_col        = dw_1.GetColumn()
li_ColCount = long(describe(dw_1,"datawindow.column.count"))
if li_col     = li_ColCount then
    ll_row      = dw_1.GetRow()
    ll_RowCount = dw_1.RowCount()
    if ll_row = ll_RowCount then
       ll_row = dw_1.InsertRow(0)
             dw_1.setredraw(false)   
       scrolltorow(dw_1,ll_Row)
       setrow(dw_1,ll_Row)
       setcolumn(dw_1,1)  
       dw_1.setredraw(true)
       dw_1.SetFocus()
           dw_1.modify("datawindow.horizontalscrollposition=1")
       return 1
    end if
end if
send(handle(this),256,9,long(0,0))
return 1


PB中用回车键代替TAB键