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
[9163] 컴포넌트를 만드는데요. 이전컴포넌트의 이벤트기능을 덧붙이려면요?
김길현 [] 776 읽음    2004-04-10 02:33
안녕하세요.

  제가 에디터 컴포넌트를 수정하여 만들려고 합니다.

그런데 KeyDown, KeyUp 이벤트를 에디터 컴포넌트에서 상속받아서

기능을 추가하려고 하는데 이상한 에러가 나네요. 도움말을 봐도,

질문 난과 같이 해서 선언에러 같은 것 이 자꾸납니다.

무엇을 잘 못해 에러가 나는건지요?

==========================================
다음과 같이 해보세요.
Example입니다. 즐거운 하루되세요.

unit LsyEditpas;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Math, ExtCtrls;

type
  TLsyEdit = class(TEditPanel)
  private
    FNo1           : TEdit;
    FNo2           : TEdit;
    { Private declarations }
  protected
    { Protected declarations }
      procedure KeyPress(var Key: Char); override;  //***** 다음과 같이 쓰세요 *****
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    { Public declarations }
  published
    { Published declarations }
      property OnKeyPress; //***** 다음과 같이 쓰세요 *****
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Sample', [TLsyEdit]);
end;

procedure KeyPress(var Key: Char);
begin
   inheried;
end;
================== 질문과 답변을 보고 해서 아래와 같은 에러가 나네요?

[Error] LsyEditpas.pas(16): Declaration of 'KeyPress' differs from previous declaration

=========== 그러나 override 와  inheried 제거 하면 실행되지만, 내용은 실행이 되지 않습니다. ^^;;;

+ -

관련 글 리스트
9163 컴포넌트를 만드는데요. 이전컴포넌트의 이벤트기능을 덧붙이려면요? 김길현 776 2004/04/10
9494     Re:컴포넌트를 만드는데요. 이전컴포넌트의 이벤트기능을 덧붙이려면요? 델사랑 704 2004/04/10
9493     Re:컴포넌트를 만드는데요. 이전컴포넌트의 이벤트기능을 덧붙이려면요? civilian 777 2004/04/10
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.