New to Telerik UI for WPF? Start a free 30-day trial
Setting Owner of RadWindow to Form Handle in UI for WPF
Updated on Mar 20, 2026
Environment
| Product | UI for WPF RadWindow |
| Version | 2026.1.211 |
Description
I want to use a Telerik UI for WPF RadWindow in a WinForms application and set its owner to the handle (IntPtr) of a WinForms form.
This knowledge base article also answers the following questions:
- How to set the owner of RadWindow to a WinForms form's handle?
- How to override GetWindowOwnerHandle in RadWindow?
- How to enable modeless keyboard interop in RadWindow?
Solution
To set the owner of a Telerik UI for WPF RadWindow to a WinForms form's handle, follow these steps:
- Derive a class from RadWindow and override the
GetWindowOwnerHandlemethod. - Create a property in the derived class to store the owner's handle (
IntPtr). - In the WinForms form, assign the handle to the RadWindow's
OwnerHandleproperty prior to showing the window.
Example Code
Custom RadWindow Class
csharp
public partial class Window1 : RadWindow
{
public Window1()
{
InitializeComponent();
}
protected override IntPtr GetWindowOwnerHandle()
{
return this.OwnerHandle;
}
public IntPtr OwnerHandle { get; set; }
}
WinForms Form Integration
csharp
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
var wpfwindow = new WpfCustomControlLibrary1.Window1();
wpfwindow.HostCreated += (s, a) =>
{
ElementHost.EnableModelessKeyboardInterop(a.HostWindow);
};
wpfwindow.OwnerHandle = this.Handle;
wpfwindow.Show();
}
}
Key Points
- Override the
GetWindowOwnerHandlemethod in the RadWindow-derived class to return the form's handle. - Use
ElementHost.EnableModelessKeyboardInteropto enable keyboard interop for the WPF window.