以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  设置鼠标移到数据行  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=110738)

--  作者:裴保民
--  发布时间:2017/12/8 14:09:00
--  设置鼠标移到数据行
怎样设置添加数据后鼠标移到新增加的行行呢?
--  作者:有点甜
--  发布时间:2017/12/8 14:36:00
--  

全局代码

 

<DllImport("user32.dll", EntryPoint := "SetCursorPos")> _
Public Function SetCursorPos(x As Integer, y As Integer) As Boolean

End Function

 

调用代码

 

Dim t As Table = Tables("表A")
Dim rc As C1FlexGrid.CellRange = t.grid.Selection
Dim cellrect As System.Drawing.Rectangle = t.grid.RectangleToScreen(t.grid.GetCellRect(rc.r1,rc.c1))
SetCursorPos(cellrect.x, cellrect.y)

 


--  作者:裴保民
--  发布时间:2017/12/8 21:56:00
--  
我的窗体表是副本表,保存数据后怎么让鼠标移到新增加的行行呢?
--  作者:有点蓝
--  发布时间:2017/12/8 22:15:00
--  
增加行使用table.addnew,不要使用datatable.addnew
--  作者:裴保民
--  发布时间:2017/12/8 22:23:00
--  
我用的是Tables("机具库存资料").AddNew


--  作者:有点蓝
--  发布时间:2017/12/8 22:30:00
--  
改为副本表的名称

Tables("窗口1_Table1").AddNew


--  作者:裴保民
--  发布时间:2017/12/8 22:36:00
--  
我用得添加数据代码就是
Tables("机具批量入库窗体_Table1").AddNew


--  作者:有点蓝
--  发布时间:2017/12/8 22:43:00
--  
Dim t As Table = e.Form.Controls("Table1").Table
t.AddNew()
t.Select(t.Rows.Count - 1,0)
Dim rc As C1FlexGrid.CellRange = t.grid.Selection
Dim cellrect As System.Drawing.Rectangle = t.grid.RectangleToScreen(t.grid.GetCellRect(rc.r1,rc.c1))
SetCursorPos(cellrect.x+5, cellrect.y+5)