I found a solution.
While displaying my dropdown window it will receive activation and Windows will deactivate the main window. The fix for this is to send a
WM_NCACTIVATE
message to the parent to update its visual appearance without changing its activation status. The below code is updated in
DropDownEdit
class to solve my issue.
private const int WM_NCACTIVATE = 0x86;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
protected override void WndProc(ref Message m)
{
if ((m.Msg == WM_NCACTIVATE) && !_activating && (m.WParam != IntPtr.Zero))
{
_activating = true;
SendMessage(this.Owner.Handle, WM_NCACTIVATE, (IntPtr) 1, IntPtr.Zero);
_activating = false;
}
else
{
base.WndProc(ref m);
}
}