System.Windows.Forms.Control.ControlCollection.Add(System.Windows.Forms.Control)

Here are the examples of the csharp api class System.Windows.Forms.Control.ControlCollection.Add(System.Windows.Forms.Control) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

1. Example

Project: Krypton
Source File: KryptonDockingControl.cs
View license
private void Construct(Control control, IDockingElement innerElement)
        {
            _innerElement = innerElement;
            _innerMinimum = INNER_MINIMUM;

            // Hook into events on the target control
            _control = control;
            _control.SizeChanged += new EventHandler(OnControlSizeChanged);
            _control.Disposed += new EventHandler(OnControlDisposed);

            // Create and add a control we use to obscure the client area during multi-part operations
            _obscure = new ObscureControl();
            _obscure.Anchor = (AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom);
            _obscure.Visible = false;
            _control.Controls.Add(_obscure);

            // Create docking elements for managing each of the four control edges
            Add(new KryptonDockingEdge("Top", control, DockingEdge.Top));
            Add(new KryptonDockingEdge("Bottom", control, DockingEdge.Bottom));
            Add(new KryptonDockingEdge("Left", control, DockingEdge.Left));
            Add(new KryptonDockingEdge("Right", control, DockingEdge.Right));
        }

2. Example

Project: Krypton
Source File: KryptonControlCollection.cs
View license
[Browsable(false)]
        [EditorBrowsable(EditorBrowsableState.Never)]
        public void AddInternal(Control control)
        {
            base.Add(control);
        }

3. Example

View license
private void SimpleSettingsDialog_Load(object sender, System.EventArgs e)
		{
			SettingsPage page = this.SettingsPages[0];
			this.panel1.Controls.Add( page );
			this.Text = page.Title;
		}

4. Example

View license
private void SimpleSettingsDialog_Load(object sender, System.EventArgs e)
		{
			SettingsPage page = this.SettingsPages[0];
			this.panel1.Controls.Add( page );
			this.Text = page.Title;
		}

5. Example

View license
private void SimpleSettingsDialog_Load(object sender, System.EventArgs e)
		{
			SettingsPage page = this.SettingsPages[0];
			this.panel1.Controls.Add( page );
			this.Text = page.Title;
		}

6. Example

Project: meridian59-dotnet
Source File: AdminInfoView.cs
View license
protected void OnTrackedObjectsListChanged(object sender, ListChangedEventArgs e)
        {
            switch (e.ListChangedType)
            {
                case ListChangedType.ItemAdded:
                    AdminInfoObject obj = dataSource.TrackedObjects[e.NewIndex];
                    
                    // create view usercontrol
                    AdminInfoObjectView view = new AdminInfoObjectView();
                    view.Dock = DockStyle.Fill;
                    view.DataSource = dataSource.TrackedObjects[e.NewIndex];
                    view.Close += OnAdminInfoObjectViewClose;
                    view.CommandSend += OnAdminInfoObjectCommandSend;

                    // create tabpage and add view
                    TabPage tabPage = new TabPage();
                    tabPage.Text = "(" + obj.ID.ToString() + ") " + obj.ClassName;
                    tabPage.Controls.Add(view);
                    
                    // add tabpage an set active
                    tabObjects.TabPages.Add(tabPage);
                    tabObjects.SelectedTab = tabPage;
                    break;

                case ListChangedType.ItemDeleted:
                    break;

                case ListChangedType.Reset:
                    tabObjects.TabPages.Clear();
                    break;
            }
        }

7. Example

View license
protected override void OnLoad(EventArgs e)
    {
      TabPage demoPage;

      base.OnLoad(e);

      demoPage = new TabPage
                 {
                   UseVisualStyleBackColor = true,
                   Padding = new Padding(9),
                   Text = "Demonstrations"
                 };

      demoGroupBox.Dock = DockStyle.Fill;
      demoPage.Controls.Add(demoGroupBox);

      this.TabControl.TabPages.Insert(0, demoPage);
      this.TabControl.SelectedTab = demoPage;

      this.Text = "Cyotek ImageBox Control for Windows Forms";
    }

8. Example

View license
protected override void OnLoad(EventArgs e)
    {
      TabPage demoPage;

      base.OnLoad(e);

      demoPage = new TabPage
                 {
                   UseVisualStyleBackColor = true,
                   Padding = new Padding(9),
                   Text = "Demonstrations"
                 };

      groupBox1.Dock = DockStyle.Fill;
      demoPage.Controls.Add(groupBox1);

      this.TabControl.TabPages.Insert(0, demoPage);
      this.TabControl.SelectedTab = demoPage;

      this.Text = "Cyotek ColorPicker Controls for Windows Forms";
    }

9. Example

Project: NFSe.Net
Source File: BarcodeTest.cs
View license
private void BarcodeTest_Load(object sender, EventArgs e)
        {
            Font f = new Font("Code 128", 80);
            this.Font = f;

            Label l = new Label();
            l.Text = "1234567890";
            l.Size = new System.Drawing.Size(800, 600);
            this.Controls.Add(l);

            this.Size = new Size(800, 600);
        }

10. Example

Project: VisualPlus
Source File: VisualBadge.cs
View license
private void Attach()
        {
            _control.Controls.Add(_badgeLabel);
        }

11. Example

View license
private void AddTab()
        {
            TabPage page = new TabPage("CSP Rule Collector");
            var ruleCollectionView = new RuleCollectionView(collector);
            ruleCollectionView.Dock = DockStyle.Fill;
            page.Controls.Add(ruleCollectionView);
            FiddlerApplication.UI.tabsViews.TabPages.Add(page);
        }

12. Example

View license
private TextBox AddTextBox()
        {
            var textBox = new TextBox
            {
                Font = new Font(FontFamily.GenericMonospace, 11.0f),
                Multiline = true,
                ScrollBars = ScrollBars.Both,
                ReadOnly = true
            };

            var textBoxPanel = new Panel
            {
                Dock = DockStyle.Fill
            };

            textBoxPanel.Controls.Add(textBox);
            Controls.Add(textBoxPanel);

            textBox.Resize += (sender, arg) => textBoxPanel.Size = ((Control)sender).Size;

            return textBox;
        }

13. Example

Project: dp2
Source File: TableControlBase.cs
View license
public void SetTitleLine(List<string> titles)
        {
            int nColumnIndex = 0;
            foreach (string title in titles)
            {
                Label label = new Label();
                label.Dock = DockStyle.Fill;
                label.Size = new Size(6, 23);
                label.AutoSize = true;
                label.Margin = new Padding(0, 0, 0, 0);
                label.Text = title;
                this.tableLayoutPanel_content.Controls.Add(label, nColumnIndex++, 0);
            }
        }

14. Example

View license
internal void AddToTable(TableLayoutPanel table,
                int nRow)
            {
                table.Controls.Add(this.label, 0, nRow);

                if (this.textBox != null)
                    table.Controls.Add(this.textBox, 1, nRow);
                else if (this.comboBox != null)
                    table.Controls.Add(this.comboBox, 1, nRow);

                // AddEvents();
            }

15. Example

Project: dp2
Source File: ZQueryControl.cs
View license
public void AddToTable(TableLayoutPanel table, 
            int nRow)
        {
            table.Controls.Add(this.comboBox_logicOperator, 0, nRow);
            table.Controls.Add(this.textBox_word, 1, nRow);
            table.Controls.Add(this.comboBox_from, 2, nRow);

            if (nRow == 1)
            {
                this.comboBox_logicOperator.Enabled = false;
            }
        }

16. Example

Project: dp2
Source File: OrderListViewerForm.cs
View license
public Sheet CreateSheet(string name)
        {
            Sheet sheet = (Sheet)_sheetTable[name];
            if (sheet != null)
                return sheet;

            sheet = new Sheet();
            sheet.TabPage = new TabPage();
            sheet.TabPage.Text = name;
            sheet.WebBrowser = new WebBrowser();
            sheet.WebBrowser.Dock = DockStyle.Fill;
            sheet.TabPage.Controls.Add(sheet.WebBrowser);
            this.tabControl_main.TabPages.Add(sheet.TabPage);

            OrderListScript script = new OrderListScript();
            script.Sheet = sheet;
            script.BatchOrderForm = this.BatchOrderForm;
            sheet.WebBrowser.ObjectForScripting = script;

            _sheetTable[name] = sheet;
            return sheet;
        }

17. Example

Project: dockpanelsuite
Source File: DockPanel.cs
View license
internal void LoadDockWindows()
        {
            m_dockWindows = new DockWindowCollection(this);
            foreach (var dockWindow in DockWindows)
            {
                Controls.Add(dockWindow);
            }
        }

18. Example

Project: DotSpatial
Source File: Paging.cs
View license
public void AddButtons(TabPage tab)
        {
            foreach (var button in _listOfButtons)
            {
                tab.Controls.Add(button);
            }
        }

19. Example

Project: DotSpatial
Source File: CustomHeaderControl.cs
View license
public void OnImportsSatisfied()
        {
            _mainmenu = new MainMenu();

            var form = (Form)Shell;
            form.Menu = _mainmenu;

            _container = new FlowLayoutPanel
            {
                Name = "Default Group",
                Height = 0,
                Dock = DockStyle.Top,
                FlowDirection = FlowDirection.LeftToRight,
                WrapContents = true,
                AutoSize = true,
                AutoSizeMode = AutoSizeMode.GrowAndShrink
            };
            Shell.Controls.Add(_container);
        }

20. Example

Project: DotSpatial
Source File: CustomHeaderControl.cs
View license
public override object Add(TextEntryActionItem item)
        {
            var textBox = new TextBox {Name = item.Key};
            if (item.Width != 0)
            {
                textBox.Width = item.Width;
            }
            textBox.TextChanged += delegate
            {
                item.PropertyChanged -= TextEntryActionItemPropertyChanged;
                item.Text = textBox.Text;
                item.PropertyChanged += TextEntryActionItemPropertyChanged;
            };
            _container.Controls.Add(textBox);
            item.PropertyChanged += TextEntryActionItemPropertyChanged;
            return textBox;
        }

21. Example

Project: EDDiscovery
Source File: TestTabStrip.cs
View license
private Control TabStrip1_OnCreateTab(ExtendedControls.TabStrip t, int no)
        {
            UserControl uc = new UserControl();
            uc.BackColor = Color.Cyan;
            Label lb = new Label();
            lb.Location = new Point(10, 10);
            lb.Text = "User Control " + (no+0);
            uc.Name = "UC " + no;
            uc.Dock = DockStyle.Fill;
            uc.Controls.Add(lb);
            tabStrip1.SetControlText("<" + uc.Name + ">");
            return uc;
        }

22. Example

Project: BehaviorIsManaged
Source File: FormHelper.cs
View license
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "Objects are disposed elsewhere")]
        internal static RichTextBox CreateRichTextBox(string name, Form parentForm)
        {
            var rtb = new RichTextBox();
            rtb.Dock = System.Windows.Forms.DockStyle.Fill;
            rtb.Location = new System.Drawing.Point(0, 0);
            rtb.Name = name;
            rtb.Size = new System.Drawing.Size(parentForm.Width, parentForm.Height);
            parentForm.Controls.Add(rtb);
            return rtb;
        }

23. Example

Project: moddingSuite
Source File: Icon.cs
View license
public override void attachTo(System.Windows.Forms.Control c)
        {
            c.Controls.Add(position);
            c.Paint += paintEvent;
        }

24. Example

Project: moddingSuite
Source File: Spawn.cs
View license
public override void attachTo(System.Windows.Forms.Control c)
        {
            c.Controls.Add(head);
            c.Controls.Add(source);
            c.Paint += paintEvent;
        }

25. Example

Project: moddingSuite
Source File: Zone.cs
View license
public override void attachTo(Control c)
        {
            c.Paint += new PaintEventHandler(paint);
            c.Controls.Add(attachPoint);
            outline.attachTo(c);

        }

26. Example

Project: vsSolutionBuildEvent
Source File: TextEditor.cs
View license
protected void attachWpfEditor(AvalonEditorWPF editor)
        {
            Controls.Add(new ElementHost()
            {
                Dock    = DockStyle.Fill,
                Child   = editor
            });
        }

27. Example

Project: CSVAnalyzerPro
Source File: Form1.cs
View license
private void NewPluginStoreTab() {
            TabPage tp = new TabPage();

            WebBrowser wb = new WebBrowser();
            System.Uri uri = new System.Uri("https://deathcrow.altervista.org/update/PluginStore/index.php");
            wb.Url = uri;

            tp.Controls.Add(wb);
            tabControl1.TabPages.Add(tp);
            tabControl1.SelectedTab = tp;
        }

28. Example

Project: fomm
Source File: PanelToolStrip.cs
View license
public void addToolStripItem(PanelToolStripItem p_pdiItem)
      {
        p_pdiItem.Selected += psiButton_Selected;
        Controls.Add(p_pdiItem.Button);
      }

29. Example

Project: FAtiMA-Toolkit
Source File: FormHelper.cs
View license
public static void ShowFormInContainerControl(Control ctl, Form frm)
        {
            frm.TopLevel = false;
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.Dock = DockStyle.Fill;
            frm.Visible = true;
            ctl.Controls.Add(frm);
        }

30. Example

View license
private LinkedTreeView createBaseTree() {
      var tree = new LinkedTreeView(this);
      tree.BorderStyle    = BorderStyle.None;
      tree.Width          = Screen.PrimaryScreen.Bounds.Width / 7;
      tree.AfterCollapse += new TreeViewEventHandler(this.updateTrees);
      tree.AfterExpand   += new TreeViewEventHandler(this.updateTrees);
      tree.HideSelection  = false;
      this.Controls.Add(tree);
      return tree;
    }

31. Example

View license
private void createLabel(string label) {
      this.AutoSize = true;

      this.Label  = new Label() {
        Text      = label,
        Anchor    = AnchorStyles.Left | AnchorStyles.Top ,
        TextAlign = ContentAlignment.MiddleLeft
      };
      this.Controls.Add(this.Label);
    }

32. Example

View license
private void createTabControl() {
			TabControl tabs = new TabControl () {
        Alignment     = TabAlignment.Top,
        Dock          = DockStyle.Fill,
			  Appearance    = TabAppearance.FlatButtons,
        SelectedIndex = 0,
        Padding       = new System.Drawing.Point(15, 7)
      };
      
      tabs.SelectedIndexChanged += new EventHandler(this.handleTabSelection);

			this.BusinessItems = new BusinessItemTabPage(this);
      tabs.Controls.Add( this.BusinessItems );

      this.DataItems = new DataItemTabPage(this);
			tabs.Controls.Add( this.DataItems );

      this.ColumnLinks = new ColumnLinkTabPage(this);
      tabs.Controls.Add( this.ColumnLinks );

			this.Controls.Add(tabs);

      // manually trigger focus on first tab
      this.BusinessItems.HandleFocus();
    }

33. Example

Project: gitextensions
Source File: FormContributors.cs
View license
private TabPage getNewTabPage(TextBox tb, string caption)
        {
            TabPage tp = new TabPage();
            tp.Margin = new System.Windows.Forms.Padding(0);
            tp.Text = caption;
            tp.Controls.Add(tb);
            return tp;
        }

34. Example

View license
private void CreateGroupBox(String aGroupBoxCaption)
        {
            var gbox = new GroupBox();
            groupBox = gbox;
            groupBox.Text = aGroupBoxCaption;
            groupBox.AutoSize = true;
            groupBox.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            groupBox.Controls.Add(Panel);
        }

35. Example

View license
private void CreateBuildReportTabPage(TabControl tabControl)
        {
            this.buildReportTabPage = new TabPage
                {
                    Padding = new Padding(3),
                    TabIndex = tabControl.Controls.Count,
                    Text = _caption,
                    UseVisualStyleBackColor = true
                };
            this.buildReportWebBrowser = new WebBrowserCtrl
            {
                Dock = DockStyle.Fill
            };
            this.buildReportTabPage.Controls.Add(this.buildReportWebBrowser);
        }

36. Example

View license
[NotNull]
        private static Panel CreateViewHeader()
        {
            var panelHeaderMain = new TableLayoutPanel() {BackColor = SystemColors.ControlLightLight, Dock = DockStyle.Fill, AutoSize = true, Margin = Padding.Empty, Padding = Padding.Empty, RowCount = 2, ColumnCount = 1};

            Label labelTitle;
            panelHeaderMain.Controls.Add(labelTitle = new Label() {Text = Globalized.Strings.SparseWorkingCopy.Text, Dock = DockStyle.Bottom, AutoSize = true, Margin = new Padding(10, 10, 10, 0)});
            labelTitle.Font = new Font(labelTitle.Font, FontStyle.Bold);

            panelHeaderMain.Controls.Add(new Label() {Text = Globalized.Strings.HeaderDetailsText.Text, Dock = DockStyle.Bottom, AutoSize = true, Margin = new Padding(25, 6, 10, 10)});

            return panelHeaderMain;
        }

37. Example

View license
public override IEnumerable<ISetting> GetSettings()
        {
            yield return enabledSettings;
            jiraFields.CustomControl = new TextBox { ReadOnly = true, Multiline = true, Height = 55, BorderStyle = BorderStyle.None };
            yield return jiraFields;
            urlSettings.CustomControl = new TextBox();
            yield return urlSettings;
            userSettings.CustomControl = new TextBox();
            yield return userSettings;
            passwordSettings.CustomControl = new TextBox { UseSystemPasswordChar = true };
            yield return passwordSettings;
            jdlQuerySettings.CustomControl = new TextBox();
            yield return jdlQuerySettings;
            var txtTemplate = new TextBox { Height = 75, Multiline = true, ScrollBars = ScrollBars.Horizontal };
            btnPreview = new Button { Text = "Preview", Top = 45, Anchor = AnchorStyles.Right };
            btnPreview.Click += btnPreviewClick;
            txtTemplate.Controls.Add(btnPreview);
            stringTemplateSetting.CustomControl = txtTemplate;
            yield return stringTemplateSetting;
        }

38. Example

Project: MaterialWinforms
Source File: MainForm.cs
View license
private void materialFlatButton6_Click(object sender, EventArgs e)
        {
            UserControl t = new UserControl();
            MaterialColorPicker mcp = new MaterialColorPicker();
            t.Size = mcp.Size;
            t.Controls.Add(mcp);
            MaterialDialog.Show("Pick a Color",t,MaterialDialog.Buttons.OK);
        }

39. Example

Project: ArnoldSimulator
Source File: DockPanel.cs
View license
internal void LoadDockWindows()
        {
            m_dockWindows = new DockWindowCollection(this);
            foreach (var dockWindow in DockWindows)
            {
                Controls.Add(dockWindow);
            }
        }

40. Example

Project: BaiduCloudSupport
Source File: TimeGrid.cs
View license
private void InitPanel(PictureBox p)
        {
            p.BackColor = UnselectedColor;
            p.BorderStyle = BorderStyle.FixedSingle;
            p.Visible = true;
            p.MouseMove += new MouseEventHandler(panel_MouseMove);
            p.Tag = Unselected;
            this.Controls.Add(p);
        }

41. Example

Project: HaSuite
Source File: ThumbnailFlowLayoutPanel.cs
View license
public ImageViewer Add(Bitmap bitmap, String name, bool Text)
        {
            ImageViewer imageViewer = new ImageViewer();
            imageViewer.Dock = DockStyle.Bottom;
            imageViewer.Image = new Bitmap(bitmap); // Copying the bitmap for thread safety
            imageViewer.IsText = Text;
            imageViewer.Width = bitmap.Width + 8;
            imageViewer.Height = bitmap.Height + 8 + ((Text) ? 12 : 0);
            imageViewer.Name = name;
            imageViewer.IsThumbnail = false;

            Controls.Add(imageViewer);

            return imageViewer;
        }

42. Example

Project: Rosin
Source File: Main.cs
View license
public void OnLoad()
        {
            //?????
            TabPage oPage = new TabPage("Rosin");

            oPage.Controls.Add(this.oConfigControl);
            this.oConfigControl.Dock = DockStyle.Fill;

            int size = FiddlerApplication.UI.tabsViews.TabPages.Count;
            FiddlerApplication.UI.tabsViews.TabPages.Insert(size, oPage);

            // add tab ?????????????? 
            // https://github.com/telerik/fiddler-docs/issues/4
            
            FiddlerApplication.UI.imglSessionIcons.Images.Add("Rosin", Rosin.Properties.Resources.icon);
            oPage.ImageKey = "Rosin";
        }

43. Example

Project: IceChat
Source File: FormMain.cs
View license
private void InitializeMainForm()
        {
            // MainTab
            this.mainTabControl =/n ..... /n //View Source file for more details /n }

44. Example

Project: IceChat
Source File: FormMain.cs
View license
internal void SetPanel(ref Panel panel, Point formLocation, string tabName)
        {
            if (formLocation.X < (this.Left + 200))
            {
                TabPage p = new TabPage(tabName);
                p.Controls.Add(panel);
                panel.Dock = DockStyle.Fill;
                this.panelDockLeft.TabControl.TabPages.Add(p);
                this.panelDockLeft.TabControl.Visible = true;
                panelDockLeft.Visible = true;
                splitterLeft.Visible = true;
                this.panelDockLeft.TabControl.SelectedTab = p;
            }
            else
            {
                TabPage p = new TabPage(tabName);
                p.Controls.Add(panel);
                panel.Dock = DockStyle.Fill;
                this.panelDockRight.TabControl.TabPages.Add(p);
                this.panelDockRight.TabControl.Visible = true;
                panelDockRight.Visible = true;
                splitterRight.Visible = true;
                this.panelDockRight.TabControl.SelectedTab = p;
            }
        }

45. Example

Project: IceChat
Source File: ClassDialog.cs
View license
public void AddControl(int iType, string caption, int x, int y, int w, int h, string id, string cont/n ..... /n //View Source file for more details /n }

46. Example

Project: IceChat
Source File: VBScriptPlugin.cs
View license
private TabPage AddEditorTab()
        {
            TabPage editorTab = new TabPage();
            editorTab.Text = "VB Scripts";
            editorText = new TextBox();
            editorText.Multiline = true;
            editorText.ScrollBars = ScrollBars.Both;
            editorText.WordWrap = false;
            editorText.Dock = DockStyle.Fill;
            editorTab.Controls.Add(editorText);

            return editorTab;
        }

47. Example

Project: Histacom2
Source File: TaskBarController.cs
View license
public Panel AddTaskbarItem95(string ApplicationID, string ApplicationName, Image ApplicationIcon, UserControl taskbar_item, Panel oldPanel)
        {
            Panel returnPanel = oldPanel;

            AvalibleApplicationID++;

            taskbar_item.BackgroundImage = ApplicationIcon;
            taskbar_item.Tag = ApplicationName;
            if (AvalibleApplicationID == 1) taskbar_item.Dock = DockStyle.Left;
            taskbar_item.Location = new Point(160 * returnPanel.Controls.Count, 0);
            returnPanel.Controls.Add(taskbar_item);

            return returnPanel;
        }

48. Example

Project: 32feet
Source File: Form1.cs
View license
private void InitializeComponent()
        {
            this.mainMenu1 = new System.Windows.Forms.MainMenu();
            this.listBox1 = new System.Windows.Forms.ListBox();
            // 
            // listBox1
            // 
            this.listBox1.Location = new System.Drawing.Point(14, 14);
            this.listBox1.Size = new System.Drawing.Size(212, 212);
            // 
            // Form1
            // 
            this.ClientSize = new System.Drawing.Size(240, 268);
            this.Controls.Add(this.listBox1);
            this.Menu = this.mainMenu1;
            this.MinimizeBox = false;
            this.Text = "Form1";
            this.Load += new System.EventHandler(this.Form1_Load);

        }

49. Example

Project: 32feet
Source File: ObjectPushForm.cs
View license
private void InitializeComponent()
		{
            this.mainMenu1 = new System.Windows.Forms.MainMen/n ..... /n //View Source file for more details /n }

50. Example

Project: PicasaUploader
Source File: Wizard.cs
View license
public void AddPage(WizardActionPage page)
        {
            page.Wizard = this;

            TabPage tab = new TabPage();
            tab.Controls.Add(page);
            page.Dock = DockStyle.Fill;

            pagesTabs.TabPages.Add(tab);
            if (pagesTabs.TabCount == 1)
                page.Initialize();
        }