move cursor down after add new item

Nov 05, 2006 2 Replies

I use a custom button to add a new item to the transaction grid. After that, the cursor in the transaction grid stays in the newly added line, it doesn't move down to a new line. I searched this newsgroup tried to find a solution. Then I used the SendKeys("{DOWN}") but it still doesn't work. My code is as following:


Public Function Process(ByRef MySession As Object) As Boolean Dim frm As New frmFare ... If frm.ShowDialog = Windows.Forms.DialogResult.OK Then



My.Computer.Keyboard.SendKeys("{DOWN}")



End If



Process = True End Function


In frmFare, when user clicks button OK, it will add new item to the grid then close the form. But just the curson doesn't move down. (and I got an error). I develop all this with vb.net.



Has anyone got an idea? Thank you very much.



Leanne



Not sure of the correct syntax in .Net, but it looks like your sendkeys may be going to the wrong window/process. See if you can find some way to ensure that the Transaction window has the focus...

Glenn Adams Tiber Creek C> I use a custom button to add a new item to the transaction grid. After

Anyone knows how to set the focus to the transaction window? Please help.

Glenn Adams [MVP - Retail Mgmt] wrote:

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required