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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

It is Possible In TextBoxExt Control

Thread ID:

Created:

Updated:

Platform:

Replies:

118019 Jan 21,2015 12:24 PM UTC Jan 22,2015 01:08 PM UTC WinForms 1
loading
Tags: TextBoxExt
Ankit
Asked On January 21, 2015 12:24 PM UTC

1> Change Back Color of TextBox When It has Focus.When
2>I want to move Cursor to next Control as per Tab Index On Enter Key

Thanks In Adavance

Ashwini Jaya Preetha Durai Samy [Syncfusion]
Replied On January 22, 2015 01:08 PM UTC

Hi Ankit,

Thank you for using Syncfusion products.

Change Back Color of TextBox When It has Focus

Your requirement can be achieved by handling theGotFocus and LostFocus events of TextBoxExt as in below code snippets.

 

Code snippets [C#]

 

// To change the TextBoxExt back color when the focus is lost

        void textBoxExt1_LostFocus(objectsender, EventArgs e)

        {

            this.textBoxExt1.BackColor =Color.WhiteSmoke;

        }

        // To change the BackColor when the Focus is got

        void textBoxExt1_GotFocus(objectsender, EventArgs e)

        {

            this.textBoxExt1.BackColor =Color.LightPink;

        }

 

 

 

I want to move Cursor to next Control as per Tab Index On Enter Key

This stated requirement can be achieved by overriding the ProcessCmdKey function. Below is the code snippet which demonstrate the same

 

// To move the next control in the form while pressing Enter key based on Tab index

        protected override boolProcessCmdKey(ref Message msg, KeyskeyData)

        {

            if (keyData == Keys.Enter)

            {

                SendKeys.Send("{TAB}");              

            }

            return base.ProcessCmdKey(refmsg, keyData);

        }

 

 

 

We have also prepared a sample for your requirement and it can be downloaded from the following link.

Sample location: http://www.syncfusion.com/downloads/support/directtrac/118019/TextBoxSample45871801.zip

 Video location: http://www.syncfusion.com/downloads/support/directtrac/118019/TextBoxExtvideo-1596920084.zip

Please let us know if need further assistance,

Regards,

Ashwini


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.

Warning Icon 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.Close Icon

;