如何在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
新聞熱點
疑難解答