Exemplo n.º 1
0
        protected override void setControl()
        {
            AgcControl agcbutton = new AgcControl();

            agcbutton.Index = 1;
            this.MButton    = new Button();
            if (mBtnWidth == 0 && mBtnHeight == 0)
            {
                this.MButton.AutoSize = true;
            }
            else
            {
                this.MButton.Size = new System.Drawing.Size(mBtnWidth, mBtnHeight);
            }
            this.MButton.Name = this.generateName();
            this.MButton.Text = this.Title;
            this.MButton.UseVisualStyleBackColor = true;
            this.MButton.Width = this.MButton.PreferredSize.Width;
            if (mEventHandler != null)
            {
                this.MButton.Click += mEventHandler;
            }
            agcbutton.MControl = this.MButton;

            MAgcCtlList.Add(agcbutton);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 在容器中添加生成控件
 /// </summary>
 /// <returns></returns>
 public List <AgcControl> generate()
 {
     this.beforeSetControl();
     this.setControl();
     this.afterSetControl();
     MAgcCtlList.Sort(delegate(AgcControl ac1, AgcControl ac2) { return(ac1.Index.CompareTo(ac2.Index)); });
     calcWidthAndHeight();
     this.afterGenerate();
     return(MAgcCtlList);
 }
        protected override void setControl()
        {
            base.setControl();

            AgcControl agcBehind = new AgcControl();

            agcBehind.Index            = 3;
            this.MLabelBehine          = new Label();
            this.MLabelBehine.AutoSize = true;
            this.MLabelBehine.Name     = this.generateName();
            this.MLabelBehine.Text     = mBehineText;
            this.MLabelBehine.Width    = this.MLabelBehine.PreferredWidth;
            agcBehind.MControl         = this.MLabelBehine;

            MAgcCtlList.Add(agcBehind);
        }