忘
忘记说爱你
Unregistered / Unconfirmed
GUEST, unregistred user!
刚开始学delphi,从网上下载了个记事本的源代码在自己读.<br>这个是对记事本中的新建命令进行的编程.可是没有MessageBox的Cancel的响应<br>该如何添加呢 ?<br>procedure TForm1.N24Click(Sender: TObject);<br>var<br>s:integer;<br>begin<br>if richedit1.Modified then<br>s:=application.MessageBox('文件已改变是否保存','确认框',MB_YESNOCANCEL)<br> //if s=idCANCEL then //到底应该怎么添加Cancel事件?<br> //begin<br> //Form1.ShowModal;<br> //end;<br>else<br>richedit1.Clear;<br>if s=idYES then<br>begin<br>savedialog1.Filter:='*.txt';<br>savedialog1.FileName:='*.txt' ;<br>if savedialog1.Execute then<br>begin<br>richedit1.Lines.SaveToFile(savedialog1.FileName);<br>richedit1.Clear;<br>end;<br>end<br>else<br>richedit1.Clear;<br>end;<br>procedure TForm1.N26Click(Sender: TObject);<br>var<br>i: integer;<br>begin<br>i:=0;<br>if printdialog1.Execute then<br>begin<br>printdialog1.Collate:=true;<br>for i:=printdialog1.FromPage to printdialog1.ToPage do<br>end;<br>end;