TransferFocusOnTab doesn''t seem to work

Hi there,

I have 4 EditControls in a form. Each of it has property TransferFocusOnTab set to true, but whenn hitting the TAB-key, a tab is inserted instead of jumping to the next control.

Syncfusion version 6.3.0.30. Is this a known issue?

Is there a way to get a workaround?

Thank you
sascha

4 Replies

NR Nandakumar R Syncfusion Team December 16, 2009 03:18 PM UTC

Hi,

Thanks for bringing this issue to our attention. I have filed a defect report on this and this will be fixed for the Essential Studio 2010 Vol.1. However, you can achieve this overriding the OnKeyDown of EditControl as shown with the code below.


public class EditControlExt : EditControl
{
public EditControlExt()
{ }

protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
if (e.KeyData == Keys.Tab && this.TransferFocusOnTab)
this.Parent.SelectNextControl(this, true, true, true, true);

else if (e.KeyData == (Keys.Shift | Keys.Tab))
this.Parent.SelectNextControl(this, false, true, true, true);
e.Handled = true;
}
}


Regards,
Nanda


MS Mr. Sascha Wald December 17, 2009 09:18 AM UTC

Hi Nanda,

thank you for the workaround. I implemented a variant of it and it works.

regards
sascha


NR Nandakumar R Syncfusion Team December 17, 2009 09:26 AM UTC

Hi,

Thanks for the update. Please post the change you made to your application to this code, so that it will helpful for users verifying this thread.

Regards,
Nanda


JT Juliano Tiago Rinaldi April 1, 2011 02:34 PM UTC

I tried another solution to the problem. I succeeded.

Private Sub edtControlFormula_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles edtControlFormula.KeyDown
If e.KeyCode = Keys.Tab Then
Me.ParentForm.SelectNextControl(Me, True, True, True, True)
End If
End Sub


Loader.
Up arrow icon