You must Sign In to post a response.
  • Category: .NET

    Move cursor from one control to another by enter event in

    I am working in I want to make a method for focus cursor from one control to another. My method pseudocode is –

    Sub MoveCursor(Byref ctrl() as Control) --Parameter which is an array of requiredcontrol

    if enter first control of array then cursor move to second control
    if enter second control then third,if thirt then forth……………..
    End Sub
    how i can write it as i can call the method with parameter a control of array.
  • #764197

    Try this:

    Sub MoveCursor(ByRef ctrl() As Control)
    Dim iCount As Int32
    For iCount = 0 To ctrl.Length - 1
    If iCount < ctrl.Length - 1 Then
    ctrl(iCount + 1).Focus()
    ctrl(iCount + 1).Select()
    End If
    End Sub

    Shashikant Gurav

  • #764216
    hi shashikant ! how i can recognize which control has been entered.i don't want to run loop.i have to recognize selected control index as i focus selected control + 1 index focus.

  • #764250

    I thought to move cursor, you were arranging controls in an array in the order you want & at the time you are passing that array of controls as a parameter to the method.

    Shashikant Gurav

  • #764255
    Hi Shashikant ! sure your idea.i want to pass an array of control as parameters.but i am unable to create event for every control enter.

    i ma unable to understand where and how i call this method.thank you so much.

  • Sign In to post your comments