TGridPanel做一个自动按比例缩放的窗体
2016-09-01 10:29
309 查看
object grdpnlAdd: TGridPanel Left = 0 Top = 0 Width = 466 Height = 268 Align = alClient //重要 BevelOuter = bvNone BorderWidth = 1 Color = clWhite ColumnCollection = < //设定3列 设定比例 item Value = 49.500000000000000000 end item Value = 1.000000000000000000 end item Value = 49.500000000000000000 end> ControlCollection = < item Column = 0 Control = pnlVehicleInfo //每个格子控制的容器 Row = 0 end item Column = 0 Control = pnlTransportInfo Row = 2 end item Column = 2 Control = pnlCarrageUnit Row = 0 end item Column = 2 Control = pnlConsignUnit Row = 2 end item Column = 0 Control = pnl1CargoInfo Row = 4 end item Column = 2 Control = pnl1Hint Row = 4 end> DoubleBuffered = True ExpandStyle = emFixedSize Locked = True Padding.Left = 1 Padding.Top = 1 Padding.Right = 1 Padding.Bottom = 1 ParentBackground = False ParentDoubleBuffered = False RowCollection = < //添加五行,设定比例 item Value = 33.000000000000000000 end item Value = 1.000000000000000000 end item Value = 27.000000000000000000 end item Value = 1.000000000000000000 end item Value = 38.000000000000000000 end> TabOrder = 0 VerticalAlignment = taAlignBottom ExplicitTop = -24 ExplicitWidth = 392 ExplicitHeight = 225 object pnlVehicleInfo: TPanel Left = 3 Top = 3 Width = 226 Height = 85 Align = alClient BevelOuter = bvNone BevelWidth = 2 BorderWidth = 2 Color = 16776180 Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentBackground = False ParentFont = False TabOrder = 0 ExplicitWidth = 190 ExplicitHeight = 70 object grpVehicleInfo: TGroupBox Left = 2 Top = 2 Width = 222 Height = 81 Align = alClient Caption = ' '#36710#36742#20449#24687' ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentFont = False TabOrder = 0 ExplicitWidth = 186 ExplicitHeight = 66 end end object pnlTransportInfo: TPanel Left = 3 Top = 92 Width = 226 Height = 69 Align = alClient BevelOuter = bvNone BevelWidth = 2 BorderWidth = 2 Color = 16776183 Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentBackground = False ParentFont = False TabOrder = 2 ExplicitTop = 77 ExplicitWidth = 190 ExplicitHeight = 57 object grpTransportInfo: TGroupBox Left = 2 Top = 2 Width = 222 Height = 65 Align = alClient Caption = ' '#36816#36755#20449#24687' ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentFont = False TabOrder = 0 ExplicitWidth = 186 ExplicitHeight = 53 end end object pnlCarrageUnit: TPanel Left = 235 Top = 3 Width = 228 Height = 85 Align = alClient BevelOuter = bvNone BevelWidth = 2 BorderWidth = 2 Color = 16776183 Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentBackground = False ParentFont = False TabOrder = 1 ExplicitLeft = 198 ExplicitWidth = 191 ExplicitHeight = 70 object grpCarrageUnit: TGroupBox Left = 2 Top = 2 Width = 224 Height = 81 Align = alClient Caption = #22996#25176#21333#20301' ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentFont = False TabOrder = 0 ExplicitWidth = 187 ExplicitHeight = 66 end end object pnlConsignUnit: TPanel Left = 235 Top = 92 Width = 228 Height = 69 Align = alClient BevelOuter = bvNone BevelWidth = 2 BorderWidth = 2 Color = 16776180 Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentBackground = False ParentFont = False TabOrder = 3 ExplicitLeft = 198 ExplicitTop = 77 ExplicitWidth = 191 ExplicitHeight = 57 object grpConsignUnit: TGroupBox Left = 2 Top = 2 Width = 224 Height = 65 Align = alClient Caption = ' '#25215#36816#21333#20301' ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentFont = False TabOrder = 0 ExplicitWidth = 187 ExplicitHeight = 53 end end object pnl1CargoInfo: TPanel Left = 3 Top = 165 Width = 226 Height = 100 Align = alClient BevelOuter = bvNone BevelWidth = 2 BorderWidth = 2 Color = 16776180 Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentBackground = False ParentFont = False TabOrder = 4 ExplicitTop = 138 ExplicitWidth = 190 ExplicitHeight = 84 object grpCargoInfo: TGroupBox Left = 2 Top = 2 Width = 222 Height = 96 Align = alClient Caption = ' '#36135#29289#20449#24687' ' Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentFont = False TabOrder = 0 ExplicitWidth = 186 ExplicitHeight = 80 end end object pnl1Hint: TPanel AlignWithMargins = True Left = 238 Top = 168 Width = 222 Height = 94 Align = alClient BevelOuter = bvNone BevelWidth = 2 BorderWidth = 2 Color = 16776180 Font.Charset = ANSI_CHARSET Font.Color = clWindowText Font.Height = -14 Font.Name = #24494#36719#38597#40657 Font.Style = [] ParentBackground = False ParentFont = False TabOrder = 5 ExplicitLeft = 201 ExplicitTop = 141 ExplicitWidth = 185 ExplicitHeight = 78 end end
全选复制,粘贴到XE 的空窗体上即可。
添加行 控件的ColumnCollection属性右键添加 Add item
添加列 控件的RowCollection 属性右键添加 Add item
控制的格子ControlCollection 就自动出来了,在上面放panel等容器,然后通过这个属性选择容器对应受到哪个格子控制。
或者用代码控制
{grdpnlAdd.ColumnCollection.BeginUpdate;
grdpnlAdd.ColumnCollection[0].Value := 49.5;
grdpnlAdd.ColumnCollection[1].Value := 1;
grdpnlAdd.ColumnCollection[2].Value := 49.5;
grdpnlAdd.ColumnCollection.EndUpdate;
grdpnlAdd.RowCollection.BeginUpdate;
grdpnlAdd.RowCollection[0].Value := 32;
grdpnlAdd.RowCollection[1].Value := 1;
grdpnlAdd.RowCollection[2].Value := 32;
grdpnlAdd.RowCollection[3].Value := 1;
grdpnlAdd.RowCollection[4].Value := 33;
grdpnlAdd.RowCollection.EndUpdate; }
相关文章推荐
- rem自适应 窗体大小自动 rem设置 改变rem来完成等比例缩放
- rem自适应 窗体大小自动 rem设置 改变rem来完成等比例缩放
- 如何一个td或table里的图片等比例缩小(css问题)图片自动缩放
- rem自适应 窗体大小自动 rem设置 改变rem来完成等比例缩放
- 一个可以使得上传的图片大小按照指定的宽度,高度自动按比例进行缩放的函数(C#)
- jquery 图片预加载 自动等比例缩放插件
- 按比例自动缩放图片的大小
- 重点推荐:VB6.0 自动缩放窗体内控件的类代码
- 将一个图片按比例缩放显示在一个Frame中。
- 随手写的一个与外部容器等比例缩放的东西,送给个美女
- 图片预加载并且自动等比例缩放的JS插件[转]
- 打开一个窗体后自动关闭当前网页可行办法
- [AutoCAD2008新功能介绍3]在AutoCAD中使用.NET来添加一个新的缩放比例
- css图片按比例自动缩放
- 图片等比例缩放 无缝滚动 下拉菜单 ——一个非常好用的jq库,
- 图片等比例缩放 无缝滚动 下拉菜单 ——一个非常好用的jq库,
- 通过Js自动按比例缩放图片
- 控件按比例随窗体缩放
- 控件随窗体自动缩放大小(c#2005)
- jq图片预加载+自动等比例缩放插件