大悟还俗

邮箱 key_ok@qq.com 我的收集 http://pan.baidu.com/share/home?uk=1177427271
  新随笔  :: 联系 :: 订阅 订阅  :: 管理

2013年10月8日

摘要: 在VCL下,常用的询问对话框包括procedure TfrmMainVCL.btnAppMessageboxClick(Sender: TObject);begin if Application.MessageBox('是否退出?', '询问', MB_YESNO + MB_ICONQUESTION) = IDYES then begin Close; end;end;或者是:uses System.UITypes;procedure TfrmMainVCL.btnMessageDlgClick(Sender: TObject);begin if Message 阅读全文

posted @ 2013-10-08 17:58 大悟还俗_2 阅读(397) 评论(0) 推荐(0) 编辑

摘要: 在VCL中,关闭程序的主窗体也就意味着程序的主循环结束,主程序自然而然结束。所以在主窗体中使用窗体的关闭函数(Close)即可,如下:procedure TfrmMain.btncloseClick(Sender: TObject);begin Close;end;在FMX中,由Activity替代了Form的概念,虽然TForm类仍然存在,但MainForm通过关闭函数无法结束程序,使用Application.Terminate均无效,调整为:uses FMX.Platform.Android;procedure TForm2.SpeedButton1Click(Sender: TObjec 阅读全文

posted @ 2013-10-08 17:56 大悟还俗_2 阅读(471) 评论(0) 推荐(0) 编辑

摘要: procedure SetBack(const AAction : JString); //后台运行。。var Intent: JIntent;begin Intent:= TJIntent.JavaClass.init(AAction); intent.addCategory(TJIntent.JavaClass.CATEGORY_HOME); Intent.setFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK); SharedActivityContext.startActivity(Intent);end;调用SetBack(TJ... 阅读全文

posted @ 2013-10-08 17:13 大悟还俗_2 阅读(236) 评论(0) 推荐(0) 编辑