一个急问题!!!(50分)

  • 主题发起人 主题发起人 源源
  • 开始时间 开始时间

源源

Unregistered / Unconfirmed
GUEST, unregistred user!
如何汉化showmessage的窗口或者改变它的caption的值。
 
查出showmessage的调用的函数

MessageDlgPos(Msg, mtCustom, [mbOK], 0, X, Y);
还可以再向下查找出MessageDlgPos调用的函数
不过不需要了
在这改就可以了
caption就是application.title
 
Application.Title := '标题名'
ShowMessage('');
不过下次用ShowMessage('')的时候你还得改.
 
还是用application.MessageBox吧.
 
或MessageDlg
 
application.MessageBox 不错呀
 
messagebox故然好,但有一个讨厌的‘咚’声,在某些情况下显得对用户很不友好?
有无更好的替代方案?
 
不是我写的,是从其它地方抄来的:

function CustorMessageDlg(const aMsg, aCaption: string): integer;
var
DialogForm: TForm;
AOkButton: TButton;
aCancelButton: TButton;
aLabel: TLabel;
i: integer;
begin
Result := 2;
DialogForm := TForm.Create(Application);
AOkButton := TButton.Create(Application);
aCancelButton := TButton.Create(Application);
aLabel := TLabel.Create(Application);
with aLabel do
begin
Font.Size := 8;
Caption := ';
for i := 1 to length(aMsg) do
begin
if (I mod 56 = 0) then
Caption := Caption + aMsg + #13
else
Caption := Caption + aMsg;
end;
Left := (400 - Width) div 2;
Top := 10;
Parent := DialogForm;
end;
with AOkButton do
begin
Font.Size := 8;
Left := 110;
Top := 20 + aLabel.Height;
Width := 75;
Height := 25;
TabOrder := 0;
Caption := '确定[&O]';
Parent := DialogForm;
ModalResult := mrOk;
end;
with aCancelButton do
begin
Font.Size := 8;
Left := 215;
Top := 20 + aLabel.Height;
Width := 75;
Height := 25;
TabOrder := 1;
Caption := '取消[&C]';
Parent := DialogForm;
ModalResult := mrCancel;
end;
with DialogForm do
begin
Font.Size := 8;
Name := 'DlgForm';
Width := 400;
Height := 25 + 30 + 25 + aLabel.Height;
Caption := aCaption;
Position := poDesktopCenter;
BorderStyle := bsDialog;
if ShowModal<
>
2 then
Result := 1;
Free;
end;
end;
 
如果觉得东的一声不好听,就把注册表里HKEY_CURRENT_USER/Control Panel/Sound的
beep值改为no就行了,呵呵
 
后退
顶部