读书人

帮忙看下这段程序,多谢拉~

发布时间: 2012-02-19 19:43:38 作者: rapoo

帮忙看下这段程序,谢谢拉~~~
unit dlg;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
if MessageDlg( '想睡了吗? ',mtConfirmation,[mbYes,mbNo],0)=mbYes then
begin
ShowMessage( '甭玩了! ');
Close;
end
else
ShowMessage( '快攻关吧! ');
end;

end.


其中 if MessageDlg( '想睡了吗? ',mtConfirmation,[mbYes,mbNo],0)=mbYes then
总提示有不协调的类型,为什么呀?

[解决办法]
不应该是MBYES 应该是MRyes

读书人网 >.NET

热点推荐