• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

DelphiXE2新控件布局PanelTGridPanelTFlowPanel

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

 

Delphi XE2 新控件

Firemonkey 布局Panel

Windows平台VCl

TGridPanel TFlowPanel

 

FMX 跨平台 

TLayout TGridLayout TFlowLayout TGridPanelLayout

fmx的Layout容器比panel节省资源

 TGridPanelLayout

 GridPanelLayout1、GridPanelLayout

http://docwiki.embarcadero.com/Libraries/Seattle/en/FMX.Layouts.TGridPanelLayout

行高设为指定的值或按比例缩放。

九宫格

TGridPanelLayout.TCellItem.SizeStyle,Absolute,Percent

选中控件,ColumnCollection,RowCollection添加列行

    GridPanel1.ControlCollection.BeginUpdate;
   while GridPanel1.ControlCollection.Count > 0 do
   GridPanel1.ControlCollection.Items[0].Control.DisposeOf;

 

http://docwiki.embarcadero.com/RADStudio/Seattle/en/FireMonkey_Layouts_Strategies

 

 TFlowLayout

控件大小可不相同。

TFlowPanel的效果图,里边是panel,左侧是TCategoryButtons,搜索框是TButtonedEdit

panel作为卡片。设置每个子panel属性即可。pnl.AlignWithMargins:=true,panel.Margins.Top:=20; 左右上下的边距设定就可以了。

 TGridLayou:表格,自动排列容器里的控件,控件大小相同可自定义大小,设定后全部控件大小相同且不变,x行y列,行数列列数根据控件大小变动。

 

 

http://edn.embarcadero.com/article/33421

 

TButtonGroup

http://docwiki.embarcadero.com/CodeExamples/XE2/en/VCLButtons%28Delphi%29

 

TRectangle 好用,有填充颜色

 

TGridPanelLayout.EGridLayoutException with message 'Cannot delete a row that contains controls

窗体的pas文件里有

{$R *.LgXhdpiPh.fmx ANDROID} ,删除就解决了。

 

TCategoryPanelGroup

 

TStackPanel

RAD Studio 10.2.2

2017.12.15

https://community.embarcadero.com/blogs/entry/new-vcl-panels-in-delphi-10-2-2

http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Using_the_Stack_Panel_Component

 堆栈Panel,一行只有一个控件(不能多列),或一列只有一个控件(不能多行)

The stack panel is a panel with a special layout. All controls added to it are placed in a different "row" (or column if you set it horizontally). The controls can be aligned to the left, the right, the center or use the entire space (fill). You set the default alignment at the stack panel level, and you can override it for each individual control (or use the special default value to pick the parent control setting). Each of the controls hosted by the panel, gets three additional properties "injected" by the container -- at the bottom of the Object Inspector list -- as you can see below:

 

Seattle就有了

http://docwiki.embarcadero.com/CodeExamples/Tokyo/en/VCL.RelativePanel_Sample

http://docwiki.embarcadero.com/RADStudio/Tokyo/en/What%27s_New_in_Seattle

示例源码

win10布局控件

横向居中,纵向居中

AlignHorizontalCenterWithPanel

AlignVerticalCenterWithPanel

不需要些代码计算左边,自动水平居中 垂直居中 ,横向纵向居中!!!

布局就方便了。

 

TCardPanel

比pageControl方便的下一步的控件

TDatePicker 和 TTimePicker


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
delphi读取excel两种方法发布时间:2022-07-18
下一篇:
Delphi安装apk发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap