zoukankan      html  css  js  c++  java
  • DX:神奇的LayoutControl.BestFit()

    自动生成LayoutControl后,界面总是不对:

    在LayoutControl中找到一个BestFit()方法,调用后神奇的结果出现了,这不正是我想要的吗?

    测试代码:

    public partial class TEST2 : Form
    {
        public TEST2()
        {
            InitializeComponent();
        }
    
        private void TEST2_Load(object sender, EventArgs e)
        {
            layoutControl1.Root.Clear();
    
            LayoutControlItem billDateItem = new LayoutControlItem();
            billDateItem.Control = new TextEdit();
            billDateItem.Text = "日期";
            billDateItem.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            layoutControl1.Root.AddItem(billDateItem);
    
            LayoutControlItem billCodeItem = new LayoutControlItem();
            billCodeItem.Control = new TextEdit();
            billCodeItem.Text = "单号";
            billCodeItem.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            layoutControl1.Root.AddItem(billCodeItem, billDateItem, InsertType.Right);
    
            LayoutControlItem billStateItem = new LayoutControlItem();
            billStateItem.Control = new TextEdit();
            billStateItem.Text = "状态";
            billStateItem.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            layoutControl1.Root.AddItem(billStateItem, billDateItem, InsertType.Right);
    
            LayoutControlItem iotypeItem = new LayoutControlItem();
            iotypeItem.Control = new TextEdit();
            iotypeItem.Text = "出入库类型";
            iotypeItem.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            layoutControl1.Root.AddItem(iotypeItem);
    
            LayoutControlItem workshopItem = new LayoutControlItem();
            workshopItem.Control = new TextEdit();
            workshopItem.Text = "生产车间";
            workshopItem.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            layoutControl1.Root.AddItem(workshopItem, iotypeItem, InsertType.Right);
    
            LayoutControlItem warehouseItem = new LayoutControlItem();
            warehouseItem.Control = new TextEdit();
            warehouseItem.Text = "仓库";
            warehouseItem.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
            layoutControl1.Root.AddItem(warehouseItem, iotypeItem, InsertType.Right);
    
            layoutControl1.BestFit();
        }
    }
  • 相关阅读:
    markDown 语法学习
    flutter 自定义输入框组件
    flutter 学习零碎知识点01
    如何让模拟的json数据接口能够正常的在手机上有效果
    react高阶组件的使用
    如何把原生小程序项目合并的mpvue项目中
    如何把一个vue组件改为ionic/angular组件
    浅析MySQL中change与modify的区别
    如何在电脑上配置两个tomcat
    警告-SetPropertiesRule Server Service Engine Host Context
  • 原文地址:https://www.cnblogs.com/eastson/p/3865086.html
Copyright © 2011-2022 走看看