procedure TForm1.Button1Click(Sender: TObject); var AMsgDialog: TForm; ACheckBox: TCheckBox; begin AMsgDialog := CreateMessageDialog('This is a test message.', mtWarning, [mbYes, mbNo]); ACheckBox := TCheckBox.Create(AMsgDialog) ; with AMsgDialog do try Caption := 'Dialog Title' ; Height := 169; with ACheckBox do begin Parent := AMsgDialog; Caption := 'Don''t show me again.'; Top := 121; Left := 8; end; if (ShowModal = ID_YES) then begin if ACheckBox.Checked then begin //... 如果勾選了 checkbox 要做的事 end; end; finally Free; end; end;
沒有留言:
張貼留言