Delphi中messagedlg |
日期:2009-5-25 13:38:14浏览(296) |
标签:Delphi if MessageDlg('Welcome to my Delphi application. Exit now?',
mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin Close; end; MessageDlg用法 对话框类型: TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom); TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, const MessageDlg()信息的汉化 Delphi中的常量都放在consts.pas中,修改它可以达到汉化的目的.如: MessageDlg()显示的窗口标题及其中的 按钮标题都是英文,虽然不影响使用,但在一个中文软件中总显得有些不协调. 为此在consts.pas中查找以下内容: "SMsgDlgWarning" 把 SMsgDlgWarning = 'Warning'; SMsgDlgError = 'Error'; SMsgDlgInformation = 'Information'; SMsgDlgConfirm = 'Confirm'; SMsgDlgYes = '&Yes'; SMsgDlgNo = '&No'; SMsgDlgOK = 'OK'; SMsgDlgCancel = 'Cancel'; SMsgDlgHelp = '&Help'; SMsgDlgHelpNone = 'No help available'; SMsgDlgHelpHelp = 'Help'; SMsgDlgAbort = '&Abort'; SMsgDlgRetry = '&Retry'; SMsgDlgIgnore = '&Ignore'; SMsgDlgAll = '&All'; SMsgDlgNoToAll = 'N&o to All'; SMsgDlgYesToAll = 'Yes to &All'; 改成 SMsgDlgWarning = '警告'; SMsgDlgError = '错误'; SMsgDlgInformation = '提示'; SMsgDlgConfirm = '确认'; SMsgDlgYes = '是(&Y)'; SMsgDlgNo = '不(&N)'; SMsgDlgOK = '确定'; SMsgDlgCancel = '取消'; SMsgDlgHelp = '帮助(&H)'; SMsgDlgHelpNone = '没有该帮助信息'; SMsgDlgHelpHelp = '帮助'; SMsgDlgAbort = '放弃(&A)'; SMsgDlgRetry = '重试(&R)'; SMsgDlgIgnore = '忽略(&I)'; SMsgDlgAll = '全部(&A)'; SMsgDlgNoToAll = '全都不(&O)'; SMsgDlgYesToAll = '全都是(&A)'; 然后重新编译Consts.pas,把Consts.duc 拷到delphi的lib和slib子目录下,就一劳永逸啦! |