We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

TransferFocusOnTab doesn''t seem to work

Thread ID:

Created:

Updated:

Platform:

Replies:

92053 Dec 16,2009 08:37 AM Apr 1,2011 10:34 AM Windows Forms 4
loading
Tags: EditControl
Mr. Sascha Wald
Asked On December 16, 2009 08:37 AM

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

Nandakumar R [Syncfusion]
Replied On December 16, 2009 10:18 AM

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

Mr. Sascha Wald
Replied On December 17, 2009 04:18 AM

Hi Nanda,

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

regards
sascha

Nandakumar R [Syncfusion]
Replied On December 17, 2009 04:26 AM

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

Juliano Tiago Rinaldi
Replied On April 1, 2011 10:34 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;