试图让自定义对话框与按钮名称武器 1 、武器 2 和取消一起使用。但是使用此代码,当我尝试编译它时,它在 Result 上给出错误未定义错误消息是
[DCC 错误] ssClientHost.pas(760):E2003 未声明的标识符:“结果”
代码是:
with CreateMessageDialog('Pick What Weapon', mtConfirmation,mbYesNoCancel) do
try
TButton(FindComponent('Yes')).Caption := Weapon1;
TButton(FindComponent('No')).Caption := Weapon2;
Position := poScreenCenter;
Result := ShowModal;
finally
Free;
end;
if buttonSelected = mrYes then ShowMessage('Weapon 1 pressed');
if buttonSelected = mrAll then ShowMessage('Weapon 2 pressed');
if buttonSelected = mrCancel then ShowMessage('Cancel pressed');