试试<br>procedure TForm1.Button1Click(Sender: TObject); <br>Var <br> AMsgDialog: TForm; <br> ACheckBox: TCheckBox; <br>begin <br> AMsgDialog := CreateMessageDialog('This is a test message.', mtWarning, [mbYes, mbNo]); <br> ACheckBox := TCheckBox.Create(AMsgDialog); <br> with AMsgDialog do <br> try <br> Caption := 'Dialog Title' ; <br> Height := 169; <br><br> With ACheckBox do <br> begin <br> Parent := AMsgDialog; <br> Caption := 'Don''t show me again.'; <br> top := 121; <br> Left := 8; <br> end; <br><br> Case ShowModal of <br> ID_YES: ;//your code here after dialog closed <br> ID_NO: ; <br> end; <br> If ACheckBox.Checked then <br> begin <br> //... <br> end; <br> finally <br> ACheckBox.Free; <br> Free; <br> end; <br>end; <br>