在procedure WMMouseActivate(var Message: TMessage);message WM_MOUSEACTIVATE; 中:<br><br> Message.Result := MA_NOACTIVATE;<br><br>这是以前我写一个类似于ComboBox的控件时用的, 由一个Edit加自编的一个弹处Panel组合而成.<br><br> TPopupPanel = class(TCustomControl)<br> private<br> procedure WMMouseActivate(<br> var Message: TMessage); message WM_MOUSEACTIVATE;<br> protected<br> FPanel: TPanel;<br> FEditor: TWinControl;<br> procedure CreateParams(var Params: TCreateParams); override;<br> procedure InvalidateEditor; virtual;<br> public<br> constructor Create(AOwner: TComponent); override;<br> procedure Hide;<br> procedure Show(P: TPoint);<br> //property OnCloseUp: TCloseUpEvent read FCloseUp write FCloseUp;<br> end;<br><br><br>procedure TPopupPanel.WMMouseActivate(var Message: TMessage);<br>begin<br> Message.Result := MA_NOACTIVATE;<br>end;<br>