diff --git a/lcl/interfaces/wince/wincewsforms.pp b/lcl/interfaces/wince/wincewsforms.pp index aa5599fc11..d756f65e9f 100644 --- a/lcl/interfaces/wince/wincewsforms.pp +++ b/lcl/interfaces/wince/wincewsforms.pp @@ -89,6 +89,7 @@ type class procedure SetIcon(const AForm: TCustomForm; const Small, Big: HICON); override; class procedure SetShowInTaskbar(const AForm: TCustomForm; const AValue: TShowInTaskbar); override; class procedure ShowModal(const ACustomForm: TCustomForm); override; + class procedure ShowHide(const AWinControl: TWinControl); override; end; { TWinCEWSForm } @@ -126,7 +127,7 @@ type implementation -uses Winceint; +uses Winceint, wincewsmenus; { TWinCEWSScrollBox } @@ -454,4 +455,20 @@ begin BringWindowToTop(ACustomForm.Handle); end; +class procedure TWinCEWSCustomForm.ShowHide(const AWinControl: TWinControl); +var + lForm: TCustomForm absolute AWinControl; +begin + TWinCEWSWinControl.ShowHide(AWinControl); + + // In atPDA mode, if there is no menu installed, we need to remove + // the menu of the previously focused application, otherwise it will + // remain visible + if (Application.ApplicationType = atKeyPadDevice) and + (lForm.Menu = nil) then + begin + CeSetMenu(AWinControl.Handle, 0, nil); + end; +end; + end.