こんにちは、私は次のものを持っています:selectedPanelはクリックされたパネルオブジェクトを取得する必要があり、フォームがクリックされた場合、selectedPanelは「null」、nada、emptyなどになる必要があります:)
var
selectedBlock: Tpanel; <== fixed typo
...
procedure TForm1.stubPanelMouseDown(Sender: TObject...
begin
...
Panel:= Sender as TPanel;
if (*selectedBlock is not null*) then
begin
// ie, store the current panel
selectedBlock:= Panel;
end
else
begin
// empty the selection
*selectedBlock:= null*;
end;
問題は、その変数を「null」に設定する方法です。selectedBlock:= Unassigned を実行するとエラーが発生します。
ありがとう
編集:これはまだエラーをスローします:アクセス違反
if (selectedBlock=nil) then <= fixed and works
begin
selectedBlock:= Panel;
end
else
begin
selectedBlock:= nil;
end;