Delphi Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
델파이 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
FreePascal/Lazarus
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

델파이 Q&A
Delphi Programming Q&A
[13596] 폼에서 마우스가 떠날때 CMMouseLeave이벤트가 일어나지 않습니다
하두고 [hadugo] 1704 읽음    2011-02-11 23:01
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, pngimage, ExtCtrls;
type
  TForm1 = class(TForm)
    Image1: TImage;
    Image2: TImage;
  private
    { Private declarations }
     procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
     procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.CMMouseEnter(var Message: TMessage);
Begin
   Image1.Hide;
   Image2.Show;
   inherited;
End;
procedure TForm1.CMMouseLeave(var Message: TMessage);
Begin
   Image1.Show;
   Image2.Hide; 
   inherited;
End;
end.


이렇게 하면 된다고 해서 해봤는데
폼에서 마우스가 떠날때 CMMouseLeave이벤트가 일어나지 않고
다른 창이 제가 만든 폼을 가릴때 CMMouseLeave이벤트가 발생합니다.
어느부분이 잘못된건가요?

자세히 보니 CMMouseLeave는 마우스 커서가 창의 테두리를 지날때 이벤트가 일어나던데
혹시 Form.Style이 bsNone이라 테두리가 없어서 그런걸까요?

Form.Style을 bsSingle로 해도 문제는 있습니다.
마우스가 창의 테두리를 지날때 아주 빨리 지나가 버리면 이벤트가 발생하지 않거든요.

이거 해결할 방법 아시는 분 좀 도와주세요.

+ -

관련 글 리스트
13596 폼에서 마우스가 떠날때 CMMouseLeave이벤트가 일어나지 않습니다 하두고 1704 2011/02/11
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.