《多文档界面设计.pptVIP

  • 3
  • 0
  • 约1.96万字
  • 约 92页
  • 2016-12-29 发布于北京
  • 举报
  6.5.3 主窗体的Timer组件   添加Timer组件,其功能是将系统的时间和日期返回到状态栏的第三个区域。   程序代码如下:   procedure TForm1.Timer1Timer(Sender: TObject);   begin    StatusBar1.Panels[2].Text:= formatdatetime(‘“今日是:”dddddd ddd “ 时间:”h“:” n “:”s’,now);   end; Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile 5.2.0.0. Copyright 2004-2011 Aspose Pty Ltd.   6.5.4 主窗体其他事件   关于主窗体的其他事件程序代码。   1.关闭询问   当窗体关闭时,若未保存文件,则弹出对话框询问是否保存。当用户单击“是”按钮时,保存文档并退出;当用户单击“否”按钮时,不保存文档直接退出;当用户单击“取消”按钮时,关闭询问对话框。 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile 5.2.0.0. Copyright 2004-2011 Aspose Pty Ltd.   程序代码如下:   procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);   var   //保存用户单击按钮的信息   answer:integer;   begin   //统计是否有子窗体存在 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile 5.2.0.0. Copyright 2004-2011 Aspose Pty Ltd.   if mdichildcount0 then    begin    if form2.RichEdit1.Modified then      begin      //弹出询问对话框     answer:=messagedlg(‘文件未保存,是否退出多文档程序?’,mtConfirmation,   [mbyes,mbno,mbcancel],0); Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile 5.2.0.0. Copyright 2004-2011 Aspose Pty Ltd. begin  form2.RichEdit1.Lines.SaveToFile(filepath);  //状态栏的修改标记   StatusBar1.Panels[1].Text :=‘’; end else begin   if SaveDialog1.Execute then    begin Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile 5.2.0.0. Copyright 2004-2011 Aspose Pty Ltd.  form2.RichEdit1.Lines.SaveToFile(SaveDialog1.FileName);  //状态栏的修改标记  StatusBar1.Panels[1].Text :=‘’;  end else ; end; end; Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile 5.2.0.0. Copyright 2004-2011 Aspose Pty Ltd.   (2)当鼠标指向“保存”按钮时,在状态栏第一个区域中提示“保存”,完成此功能,其事件和程序代码如下:   procedure TForm1.ToolButton3MouseMove(Sender: TObject; Shift: TShiftState;X, Y: Integer);   begin    //状态栏的提示标记信息为保存    St

文档评论(0)

1亿VIP精品文档

相关文档