delphi xe 应用程序横竖屏设置  
官方Delphi 学习QQ群: 682628230(三千人)
频道

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,你就可以勾选它下面的四个选项(PortraitUpside downLandscape home rightLandscape home left),其中Landscape home rightLandscape home left表示横屏,PortraitUpside down表示竖屏。

 

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


推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.033040046691895 seconds