当前位置: 首页>>代码示例>>C#>>正文


C# Control.Add方法代码示例

本文整理汇总了C#中System.Windows.Forms.Control.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Control.Add方法的具体用法?C# Control.Add怎么用?C# Control.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Control的用法示例。


在下文中一共展示了Control.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: addTo

 public void addTo(Control.ControlCollection controls)
 {
     controls.Add(depthTextBox);
     controls.Add(statusLabel);
     controls.Add(amountTextBox);
     controls.Add(deleteCheckBox);
 }
开发者ID:p-ledenev,项目名称:CSharp_portfoliosInit,代码行数:7,代码来源:MachineForm.cs

示例2: CheckBox

        /// <summary>
        /// Construct a new check box with no key button.
        /// </summary>
        /// <param name="location"></param>
        /// <param name="name"></param>
        /// <param name="isChecked"></param>
        /// <param name="OnButtonChecked"></param>
        /// <param name="OnButtonUnchecked"></param>
        public CheckBox(
            Control.ControlCollection controls,
            Point location,
            string name,
            bool isChecked,
            Lambda OnButtonChecked,
            Lambda OnButtonUnchecked)
        {
            box = new System.Windows.Forms.CheckBox();
            box.AutoSize = true;
            box.Location = location;
            box.Checked = isChecked;
            box.Name = name;
            box.Size = new System.Drawing.Size(80, 17);
            box.TabIndex = 0;
            box.Text = name;
            box.UseVisualStyleBackColor = true;

            // Anonymous checked event handler -- callback to provided lambdas for check/uncheck behavior.
            box.CheckedChanged += delegate(Object sender, EventArgs e)
            {
                if (box.Checked)
                {
                    OnButtonChecked();
                }
                else
                {
                    OnButtonUnchecked();
                }
            };

            controls.Add(box);
        }
开发者ID:zeromeus,项目名称:gest_tracker,代码行数:41,代码来源:CheckBox.cs

示例3: FormCubeLayerVisualiser

        public FormCubeLayerVisualiser( Control.ControlCollection parentControl, Point location, guiOptions p_GuiOptions, MainForm mainForm )
        {
            int i = 0;
            this.location = location;
            this.GuiOptions = p_GuiOptions;
            this.dataPanel = new System.Windows.Forms.Panel();
            this.dataPanel.Location = location;
            this.dataPanel.Name = "panel1";
            this.dataPanel.Size = new System.Drawing.Size(320, 320);
            parentControl.Add(dataPanel);
            layerData = new PictureBox[100];
            this.parentForm = mainForm;

            for (i = 0; i < 100; i++)
            {
                this.layerData[i] = new PictureBox();
                this.layerData[i].Image = global::FadeCube.Properties.Resources.led_0;
                this.layerData[i].Location = new Point((i % 10) * 32, (i / 10) * 32);
                this.layerData[i].Name = "layerData" + i.ToString();
                this.layerData[i].Size = new System.Drawing.Size(32, 32);
                this.layerData[i].TabIndex = 0;
                this.layerData[i].TabStop = false;
                this.layerData[i].SendToBack();
                this.layerData[i].Click += new System.EventHandler(layerData_Click);
                dataPanel.Controls.Add(layerData[i]);
            }
        }
开发者ID:libesz,项目名称:FadeCube-dotNET-GUI,代码行数:27,代码来源:MainForm.cs

示例4: CreateControl

 public override Control CreateControl(IRuleControlOwner owner, Control.ControlCollection collection, System.Drawing.Point pos)
 {
     RuleControl rc = new RuleControl(owner) {Location = pos};
     rc.RestoreFromRule(this);
     DisposeControl();
     ruleControl_ = rc;
     collection.Add(rc);
     return rc;
 }
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:9,代码来源:Rule.cs

示例5: NumberFieldsTable

 public NumberFieldsTable(Control.ControlCollection Controls, Point location)
 {
     Fields = new NumberField[SIZE, SIZE];
     for (int i = 0; i < SIZE; i++)
         for (int j = 0; j < SIZE; j++)
         {
             Fields[i, j] = new NumberField(i, j, location);
             Controls.Add(Fields[i, j]);
         }
 }
开发者ID:mbassara,项目名称:sudoku,代码行数:10,代码来源:NumberFieldsTable.cs

示例6: CreateControls

        public override void CreateControls(Control.ControlCollection collection)
        {
            selectButton = new Button();
            selectButton.Width = 150;
            selectButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECT);
            selectButton.Enabled = false;
            selectButton.Click += new EventHandler(importButton_Click);

            collection.Add(selectButton);
        }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:10,代码来源:BrowserScriptSelectGeocache.cs

示例7: CreateControls

        public override void CreateControls(Control.ControlCollection collection)
        {
            reworkButton = new Button();
            reworkButton.Width = 150;
            reworkButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REWORK);
            reworkButton.Enabled = false;
            reworkButton.Click += new EventHandler(reworkButton_Click);

            collection.Add(reworkButton);
        }
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:10,代码来源:BrowserScriptRework.cs

示例8: Add

        private static int Add(Control.ControlCollection Instance,IntPtr l)
        {
            // get method arguments
                  int valueId = (int)LuaApi.lua_tonumber(l,3);
                  Control value = LuaManager.Instance.GetObjectT<Control>(valueId);

                  // call method
                  Instance.Add(value);

                  return 0;
        }
开发者ID:huiguochen,项目名称:Lua4Net,代码行数:11,代码来源:ControlCollection.cs

示例9: addButton

        /// <summary>
        /// 动态增加一个button,指定显示的文本和点击事件执行的委托
        /// </summary>
        /// <param name="Controls1">要增加的控件集合</param>
        /// <param name="text">button文本</param>
        /// <param name="buttonClickHandler1">绑定点击后执行的委托</param>
        /// <returns></returns>
        public Button addButton(Control.ControlCollection Controls1, string text,int buttonWidth,int buttonHeight, buttonClickHandler buttonClickHandler1)
        {
            Button Button1 = new Button();
            Button1.Text = text;
            Button1.Size = new Size(buttonWidth, buttonHeight);
            Button1.Click += (sender,e) =>
            {
                buttonClickHandler1(sender,e);
            };

            Controls1.Add(Button1);
            return Button1;
        }
开发者ID:lvyangxu,项目名称:ClassLibrary2Dot0,代码行数:20,代码来源:AddControl.cs

示例10: displayFormOnPanel

 public static void displayFormOnPanel(Control.ControlCollection control, Form newForm)
 {
     bool isExist = control.Contains(newForm);
     if (isExist == false)
     {
         newForm.TopLevel = false;    //设置为非顶级窗体
         newForm.FormBorderStyle = FormBorderStyle.None;       //设置窗体为非边框样式
         newForm.Dock = System.Windows.Forms.DockStyle.Fill;   //设置样式是否填充整个PANEL
         control.Add(newForm);      //添加窗体
         newForm.Show();
     }
     newForm.BringToFront();
 }
开发者ID:qq5013,项目名称:KryptonAccessController,代码行数:13,代码来源:WidgetThread.cs

示例11: MainTabControlDrawing

        private TabControl MainTabControlDrawing(Control.ControlCollection Controls)
        {
            TabControl MainTabControl = new TabControl();

            // 配置位置を設定
            MainTabControl.Location = new System.Drawing.Point(10, 10);
            // Nameプロパティを設定
            MainTabControl.Name = "tabControl";
            // 選択されているタブページのインデックス取得
            MainTabControl.SelectedIndex = 0;
            // サイズを設定
            MainTabControl.Size = new System.Drawing.Size(340, 585);
            // TabIndexを設定
            MainTabControl.TabIndex = 0;
            //MainTab表示
            Controls.Add(MainTabControl);

            return MainTabControl;
        }
开发者ID:hakuhata,项目名称:ClipBoardItems,代码行数:19,代码来源:TabPages.cs

示例12: World

 // The World constructor receives a reference to the Controls object so
 // it can add window elements (labels in this case) to the main screen
 public World(Control.ControlCollection controls, Color backColor,
     int rows, int columns, int colWidth, int rowHeight)
 {
     this.rows = rows;
     this.columns = columns;
     this.backColor = backColor;
     tiles = new Tile[rows, columns];
     for (int row = 0; row < rows; row++)
     {
         for (int col = 0; col < columns; col++)
         {
             tiles[row, col].label = new Label();
             tiles[row, col].label.AutoSize = false;
             tiles[row, col].label.BorderStyle = BorderStyle.FixedSingle;
             tiles[row, col].label.Location = new Point(col * colWidth, row * rowHeight);
             tiles[row, col].label.Size = new Size(colWidth, rowHeight);
             controls.Add(tiles[row, col].label);
         }
     }
 }
开发者ID:pakryb,项目名称:Tetris,代码行数:22,代码来源:World.cs

示例13: RelationshipView

        public RelationshipView(Control.ControlCollection collection, Essenishial one, Essenishial two, 
            ErRelationshipConnectType firsType, ErRelationshipConnectType secType,
            ErDiagram Diagram
            )
        {
            targetDiagram = Diagram;
            ErConnectEssencePair firstPair = new ErConnectEssencePair(one.Essence, firsType);
            ErConnectEssencePair secondPair = new ErConnectEssencePair(two.Essence, secType);
            targetRelationship = new ErRelationship(firstPair, secondPair);
            targetDiagram.AddRelationship(targetRelationship);

            oneEssenishial = one;
            twoEssenishial = two;
            one.OneOrTwoList.Add(1);
            two.OneOrTwoList.Add(2);
            OnePoint = one.GetCentralPoint();
            TwoPoint = two.GetCentralPoint();
            one.RelationshipViewList.Add(this);
            two.RelationshipViewList.Add(this);

            MiddlePoint = new Point((OnePoint.X + TwoPoint.X) / 2, (OnePoint.Y + TwoPoint.Y) / 2);
            containerOne = new ShapeContainer();
            OneToMiddleLine = new LineShape(OnePoint.X, OnePoint.Y, MiddlePoint.X, MiddlePoint.Y);
            OneToMiddleLine.DoubleClick += OpenRelationshipEditorWindow;
            OneToMiddleLine.BorderWidth = 3;
            OneToMiddleLine.BorderStyle = GetLineStyle(firsType.ModalType);
            MiddelToTwoLine = new LineShape(MiddlePoint.X, MiddlePoint.Y, TwoPoint.X, TwoPoint.Y);
            MiddelToTwoLine.BorderWidth = 3;
            MiddelToTwoLine.DoubleClick += OpenRelationshipEditorWindow;
            MiddelToTwoLine.BorderStyle = GetLineStyle(secType.ModalType);

            containerOne.Shapes.Add(OneToMiddleLine);
            containerOne.Shapes.Add(MiddelToTwoLine);
            //shape.
            collection.Add(containerOne);
        }
开发者ID:Etlay,项目名称:DB_cursovoy,代码行数:36,代码来源:RelationshipView.cs

示例14: shoot

 public override Bullet shoot(Control.ControlCollection controls)
 {
     int xPos = 0, yPos = 0;
     switch (direction)
     {
         case Direction.Up:
             xPos = x + width / 2 - Bullet.width / 2;
             yPos = y;
             break;
         case Direction.Down:
             xPos = x + width / 2 - Bullet.width / 2;
             yPos = y + height;
             break;
         case Direction.Left:
             xPos = x;
             yPos = y + height / 2 - Bullet.height / 2;
             break;
         case Direction.Right:
             xPos = x + width;
             yPos = y + height / 2 - Bullet.height / 2;
             break;
     }
     Bullet bullet = new Bullet(xPos, yPos, direction);
     controls.Add(bullet.picture);
     return bullet;
 }
开发者ID:SatanSec,项目名称:Tank,代码行数:26,代码来源:PlayerTank.cs

示例15: NewControl

 public static void NewControl(Control.ControlCollection controls, ref UserControl oldControl, UserControl newControl)
 {
     controls.Remove(oldControl);
     oldControl = newControl;
     controls.Add(oldControl);
 }
开发者ID:vuchannguyen,项目名称:lg-py,代码行数:6,代码来源:CommonFunction.cs


注:本文中的System.Windows.Forms.Control.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。