我做了个VCL控件具体代码如下,可注册后当时能在“Standard”中看见,但重新打开一个Project后就看不见了,但在“Configure Palette”的“Standard“能看见。这是为什么,该怎么解决?
nit QPathButton;interfaceuses
  Windows, Messages, SysUtils, Classes, QControls, QStdCtrls, ShlObj;type
  TPathButton = class(TButton)
  private
    function SelectDirectoryEX(Handle: HWND;
const Caption: string; const Root: WideString; out Directory: string): Boolean;
    { Private declarations }
  protected
    { Protected declarations }
  public
    constructor Create(Owner: TComponent); override;
    function FileSavePath(Handle:HWND):String;
    { Protected declarations }
  public
    { Public declarations }
  published
    { Published declarations }
  end;procedure Register;implementationprocedure Register;
begin
  RegisterComponents('Standard', [TPathButton]);
end;constructor TPathButton.Create(Owner: TComponent);
begin
  inherited Create (Owner);
  width := 65;
  Height := 22;end;function TPathButton.SelectDirectoryEX(Handle: HWND;
const Caption: string; const Root: WideString; out Directory: string): Boolean;
var
   lpbi: _browseinfo;
   buf: array[0..MAX_PATH] of Char;
   ID: IShellFolder;
   eaten, att: Cardinal;
   rt: pItemIDList;
   initDir: PWideChar;
begin
   lpbi.HWNDOwner := Handle;
   lpbi.lpfn := nil;
   lpbi.lpszTitle := pchar(caption);
   lpbi.ulFlags := BIF_RETURNONLYFSDIRS + 16;
   SHGetDesktopFolder(ID);
   initdir := pwchar(Root);
   id.ParseDisplayName(0, nil, initDir, eaten, rt, att);
   lpbi.pidlRoot := rt;
   GetMem(lpbi.pszDisplayName, MAX_PATH);
   try
      Result := SHGetPathFromIDList(SHBrowseForFolder(lpbi), buf);
   except
      FreeMem(lpbi.pszDisplayName);
   end;
   if Result then Directory := buf;
end;function TPathButton.FileSavePath(Handle:HWND):String;
var
   S: string;
begin
   SelectDirectoryEX(Handle, 'Browse', 'Desktop', S);
   if S<>'' then
      Result:=S
   else
      Result:='';
end;end.

解决方案 »

  1.   

    1.install packages里面你的控件能看见么?
    2.是否已经选择
    3.有可能和TBUTTON冲突
      

  2.   

    被你隐藏了,在component->palette properties->pages中把滚动条拉到最下的all中,在右边的components中选择你做的组件,选择show即可。
      

  3.   

    不会吧..怎么可能..你看看你字母写错了还是什么..
    不然怎么会..我一般都是放在自已的PALETTE的..
      

  4.   

    被你隐藏了,在component->palette properties->pages中把滚动条拉到最下的all中,在右边的components中选择你做的组件,选择show即可。
      

  5.   

    把 TPathButton 全部替换成TMybtn或改成其他的名字,重新编译,即可。
      

  6.   

    用其他名字都可以看到,就是用TPathButton不行。奇怪,这可能是delphi的一个 bug
      

  7.   

    uses
      Windows, Messages, SysUtils, Classes, QControls, QStdCtrls, ShlObj;把QControls, QStdCtrls, 前面的Q去掉。换成Controls, StdCtrls,即可。