unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, IdBaseComponent, IdMessage; type TForm1 = class(TForm) Button1: TButton; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; RadioButton5: TRadioButton; RadioButton6: TRadioButton; RadioButton7: TRadioButton; RadioButton8: TRadioButton; RadioButton9: TRadioButton; RadioButton10: TRadioButton; RadioButton11: TRadioButton; RadioButton12: TRadioButton; RadioButton13: TRadioButton; RadioGroup1: TRadioGroup; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses Unit2; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin try // Form2¸¦ µ¿ÀûÀ¸·Î »ý¼º~ Form2 := TForm2.Create( Self ); Form2.ShowModal; finally Form2.Free; Form2 := nil; // ~Form2¸¦ µ¿ÀûÀ¸·Î »ý¼º end; end; procedure TForm1.Button2Click(Sender: TObject); begin Close; // Ãë¼Ò end; procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if MessageDlg('ÇÁ·Î±×·¥À» Á¾·áÇϽðڽÀ´Ï±î?', // Á¾·á½Ã È®Àθ޼¼Áö¶ç¿ì±â mtConfirmation, [mbYes, mbNo], 0) <> mrYes then // Yes(Á¾·á) / No(Á¾·á¾ÈÇÔ) CanClose := FALSE; // Alt + F4 ¶Ç´Â Ç¥½ÃÁÙX¹öÆ°À¸·Î ´ÝÈ÷Áö ¾Ê°Ô Çϱâ end; end.