messagebox,messagedlg可以把form上edit.text内容放在上面吗?(50分)

G

gghhjj

Unregistered / Unconfirmed
GUEST, unregistred user!
就象showmessage('error all '+edit1.text);
 
不可以.
自己画个提示窗体也是很简单的.
 
messagedlg('error all'+edit1.text,mtError,[mbOK,mbCancel],0);
 
当然可以
MessageBox(Handle,pchar('error all'+edit1.text),pchar('error'),MB_OK or MB_ICONSTOP);
 
sorry, 误以为是将Edit控件本身放在MessageDlg的对话框中.
 
同意pcexplorer
 
将Edit控件本身放在MessageDlg的对话框中:
function ShowInput(const asCaption: string): string;
var
edtInput: TEdit;
frmDlg: TForm;
begin
frmDlg := CreateMessageDialog(asCaption, mtInformation, [mbOK, mbCancel]);
with frmDlg do
try
Caption := Application.Title;
Width := 250;
Height := 123;
edtInput := TEdit.Create(frmDlg);
with edtInput do
begin
Parent := frmDlg;
Left := 56;
Top := 32;
Width := 160;
Height := 23;
TabOrder := 1;
end;

with TButton(Components[2]) do
begin
Caption := '确定';
Width := 80;
Left := 55;
Top := 65;
TabOrder := 2;
end;

with TButton(Components[3]) do
begin
Caption := '取消';
Width := 80;
Top := 65;
Left := 138;
TabOrder := 2;
end;

if ShowModal = IDOk then
Result := edtInput.Text
else
Result := '';
finally
Free;
end;
end;
 
还没结束?
 

Similar threads

顶部