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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Set the EditControl Active

Thread ID:





28348 Apr 29,2005 03:32 PM UTC Jan 23,2006 11:10 PM UTC WinForms 3
Tags: EditControl
Steve Graddy
Asked On April 29, 2005 03:32 PM UTC

First know that I am using Syncfusion v3.2.1.0 release. All syncfusion components. The MDI child form contains a Syncfusion legacy EditControl and a Syncfusion DataGrid. Similar MDI style interface as VS Studio. How do I make the EditControl the child forms active control on MDI Tab change? Currently when you make a MDI tab change the edit control does not get the cursor or become active ubtil you click inside the editor.

Administrator [Syncfusion]
Replied On April 29, 2005 04:48 PM UTC

Hi Orgbrat, Please make sure that the EditControl has the lowest TabIndex value among all the controls on the MDI child form. This way it will automatically receive focus when the MDI child form is activated. You could also force the the EditControl to receive focus by handling the Activated event of the MDI child form and using the following code : this.editControl1.Focus(); or use the SetFocus interop call SetFocus(this.editControl1.Handle); You could have to import the following library before you invoke the interop call : [DllImport("user32.dll", CharSet=CharSet.Auto)] internal static extern IntPtr SetFocus(IntPtr hWind); Please refer to the test sample attached that illustrates this and let me know if you need further assistance. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On January 23, 2006 06:23 PM UTC

[DllImport("user32.dll", CharSet=CharSet.Auto)] internal static extern IntPtr SetFocus(IntPtr hWind); Could you please provide, VB syntax for the above two lines. Thanks, Bits

Administrator [Syncfusion]
Replied On January 23, 2006 11:10 PM UTC

Hi Bits, The VB.NET syntax is : Private Declare Function SetFocus Lib _ "user32.dll" (ByVal hwnd As IntPtr) As IntPtr I have also attached the VB.NET version of my above sample here. Please refer to it and let me know if you need any other information. Regards, Guru Patwal Syncfusion, Inc.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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