• Devepress LayoutControl的使用


    一个讲述动态创建Devpress LayoutControl控件的使用例子。

    通过代码动态添加 LayoutControlItem ,TabbedControlGroup ,LayoutControlGroup 及具体控件并排版的例子。

    private void InitLayoutControl()

            {
                LayoutControlItem lci1 = layoutControlGroup.AddItem();
                DateEdit de = new DateEdit();
                lci1.Control = de;
                lci1.Text = "日期:";


                LayoutControlItem lci3 = layoutControlGroup.AddItem();
                lci3.Move(lci1, InsertType.Right);
                lci3.TextVisible = false;


                LayoutControlItem lci2 = layoutControlGroup.AddItem();
                SimpleButton sb = new SimpleButton();
                sb.Text = "确定";
                lci2.Control = sb;
                lci2.TextVisible = false;
                lci2.Move(lci3, InsertType.Right);

                TabbedControlGroup tcg = layoutControl.Root.AddTabbedGroup();

                LayoutControlGroup lcg1 = tcg.AddTabPage("one");
                LayoutControlItem lci11 = lcg1.AddItem();
                lci11.Control = new TextEdit();
                lci11.Text = "First:";
                lci11.AppearanceItemCaption.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                LayoutControlItem lci12 = lcg1.AddItem();
                lci12.Control = new TextEdit();
                lci12.Text = "Second:";
                LayoutControlItem lci13 = lcg1.AddItem();
                lci13.Control = new TextEdit();
                lci13.Text = "Three:";
                lci13.Move(lci12, InsertType.Right);

                LayoutControlGroup lcg2 = tcg.AddTabPage("two");
                LayoutControlItem lci21 = lcg2.AddItem();
                SimpleButton sb21 = new SimpleButton();
                sb21.Text = "Test";
                sb21.Click += new EventHandler(sb21_Click);
                lci21.Control = sb21;

                LayoutControlGroup lcg3 = tcg.AddTabPage("three");
                LayoutControlItem lci31 = lcg3.AddItem();
                MemoEdit me = new MemoEdit();
                me.Dock = DockStyle.Fill;
                lci31.Control = me;
                lci31.Padding = new DevExpress.XtraLayout.Utils.Padding(0);
                lci31.TextVisible = false;


            }

            void sb21_Click(object sender, EventArgs e)
            {
                foreach (Control c in layoutControl.Controls)
                {
                    MessageBox.Show(c.GetType().ToString()+":"+ c.Text);
                }
            }

    转载自:
    http://www.cnblogs.com/quan2hua/archive/2010/02/05/1664434.html
  • 相关阅读:
    OCP-1Z0-053-V12.02-235题
    OCP-1Z0-053-V12.02-524题
    OCP-1Z0-053-V12.02-525题
    OCP-1Z0-053-V12.02-526题
    OCP-1Z0-053-V12.02-535题
    OCP-1Z0-053-V12.02-540题
    OCP-1Z0-053-V12.02-617题
    OCP-1Z0-053-V12.02-649题
    如何制作Jar包并在android中调用jar包
    JAVA实现回调
  • 原文地址:https://www.cnblogs.com/icebutterfly/p/2549503.html
Copyright © 2020-2023  润新知