Set Focus on Button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gidi

    #1

    Set Focus on Button

    Hi,

    In my form i have dataGrid and button. my user can navigate between the
    dataGrid cells by clicking the enter button. if the user left an empty row
    (all cells are empty) i want that when he will click the last cell the focus
    will be on the button.

    i tried to write this code:

    if(dataGrid1.Cu rrentCell==7)
    {
    ok_btn.Focus();
    }
    but that's not bringing the ok_btn to focus, it seems like it's a tabindex
    problem, but i tried to change that too during runtime, but it didn't help.

    what can i do?

    thanks,
    Gidi
Working...