先把下面的代码保存成 TranForm.pas ;
component ->install component ->into newpackpage
            unitfile name ://加上 TranForm.pas(包括文件的路径)
            package filename ://自己定义包文件名
            package description ://自己定义描述
->ok剩下的自己看着办吧!
                
//////////////
Unit TranForm; {DragonPC 2001.2.21}
Interface
Uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms ;
Type
   TTranForm = class (TComponent)
   Private
      FAlphaValue: integer;
      FParentFormHandle: HWND;
      Procedure SetFAlphaValue (Alpha: integer);
   Protected
      Procedure UpdateDisplay;
   Public
      Constructor Create (AOwner: TComponent); override;
   Published
       Property AlphaValue: integer read FAlphaValue write SetFAlphaValue;
   End;Const
WS_EX_LAYERED = $80000;
LWA_ALPHA = 2;Procedure Register;Function SetLayeredWindowAttributes (Handle: HWND; COLORKEY: COLORREF;
Alpha: BYTE; Flags: DWORD): Boolean; stdcall; external 'USER32.DLL';ImplementationProcedure Register;
Begin
  RegisterComponents ('Standard', [TTranForm]);
End;Procedure TTranForm.SetFAlphaValue (Alpha: integer);
Begin
   if (Alpha >= 0) and (Alpha < 256) then begin
     FAlphaValue:= Alpha;
     UpdateDisplay ();
End;
End;Procedure TTranForm.UpdateDisplay;
Begin
   if (csDesigning in ComponentState) then Exit ;
   SetLayeredWindowAttributes (FParentFormHandle, 0, FAlphaValue, 2);
End;Constructor TTranForm.Create (AOwner: TComponent);
Begin
    Inherited;
    if (csDesigning in ComponentState) then Exit;
    FAlphaValue:= 255;
    FParentFormHandle:= TForm (AOwner). Handle;
    SetWindowLong (FParentFormHandle,
    GWL_EXSTYLE, GetWindowLong (FParentFormHandle, GWL_EXSTYLE) or WS_EX_LAYERED);
End;End.

解决方案 »

  1.   

    多看一些关于组件编程的书籍,我推荐“Delphi5程序员指南”这里有大量的篇幅介绍组件的编写。
      

  2.   

    编写组建和一般的编写有些差异,比如对类内的对象复制,不要用:=,用Assign方法
    调试也稍微麻烦一些。
    看看帮助吧。
      

  3.   

    soft123(泰山) 的话怎么看不懂
      

  4.   

    组件的代码中加一个过程
    prodeure Registre;
    begin
      调用RegisterComponents;//注册面板
    end;
    再放到一个包里