delphi xe 应用程序横竖屏设置


本文整理自网络,侵删。

 
应用程序禁止竖屏代码
 Application.Initialize;  
  
  //禁止竖屏,只允许横屏 
  Application.FormFactor.Orientations := [TFormOrientation.soLandscape, TFormOrientation.soInvertedLandscape];  
  //禁止横屏,只允许竖屏
  //Application.FormFactor.Orientations := [TFormOrientation.soPortrait, TFormOrientation.soInvertedPortrait];
  
  Application.CreateForm(TForm1, Form1);  
  Application.Run; 

2、工程中设置

在工程管理视图中鼠标右键,在弹出的菜单中选择Options…,在左边的列表中选中Application,在右边面板区域中的Orientation页,勾选Custom orientation,你就可以勾选它下面的四个选项(Portrait,Upside down,Landscape home right,Landscape home left),其中Landscape home right,Landscape home left表示横屏,Portrait,Upside down表示竖屏。

 

当然,它其实也是在工程代码中加上前面我们讲的那句代码。

相关阅读 >>

Delphi下载指定网址(url)的文件,带进度条显示

Delphi winapi: getmodulehandle - 获取一个模块(exe 或 dll)的句柄

Delphi 禁用启用网卡

Delphi-dbgrid取得所有表中的值

Delphi 取文件目录下所有文件名和文件目录名

Delphi android windows ios通用获取程序版本

Delphi中使用汇编(关于pos函数的问题)

Delphi settimer 用法

Delphi中clientdataset的用法小结

Delphi 的内存操作函数(5): 复制内存

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...