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. Image for the cookie policy date

Set the EditControl Active

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.

3 Replies

AD Administrator Syncfusion Team 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.


AD Administrator Syncfusion Team 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


AD Administrator Syncfusion Team 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.

Loader.
Live Chat Icon For mobile
Up arrow icon