Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6013843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:36:26+00:00 2026-05-23T02:36:26+00:00

I am trying to dynamically add form controls to a gui I’m developing in

  • 0

I am trying to dynamically add form controls to a gui I’m developing in PowerShell. I have looked at VB and C# examples but can’t seem to get my form to actually populate the gui with a new control. What I want is to be able to append a potentially large number of additional controls to the form and the added controls get dumped into a scrollable field so they don’t end up off the end of the gui. How I tried to accomplish this is append a combobox to a tablelayoutpanel. My idea being, adding a new row to the tablelayoutpanel with a new combobox control would accomplish this. So I suppose I have two questions:

  1. Is this the logically correct way of going about dynamically adding controls to an object that will allow for scrollable overflow?
  2. If #1 is true, how do I accomplish this tasK?

This is the most recent iteration of my attempts:

$button1_Click={
    $new = New-Object System.Windows.Forms.ComboBox
    Add-ComboBox $rowCount
    $rowCount++
}

function Add-ComboBox {
    param([string] $rowCount)
    $combobox = New-Object System.Windows.Forms.ComboBox
    $combobox.Dock = [System.Windows.Forms.DockStyle]::Fill
    $combobox.Text = ""
    $combobox.Tag = "ComboBox$rowCount"
    $tablelayoutpanel1.Controls.Add($combobox, 1, $rowCount)
}

Your assistance is greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:36:27+00:00Added an answer on May 23, 2026 at 2:36 am

    I found the answer on the Microsoft Technet forums. A forum moderator has been helping me out with this. Thanks though!

    http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/b2c8abeb-3ae6-4936-9bef-a50a79fdff45/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can generate the controls but can't remove them. I'm trying to add a
Trying to make a make generic select control that I can dynamically add elements
I'm trying to dynamically add a validation rule to some dynamic controls: $(input[id*=Hours]).rules(add, required);
I am trying to add a bunch of controls dynamically in rows and columns
I'm trying to add a text field to a form dynamically using javascript. From
I'm trying to add a new FilteringSelect widget dynamically to a preexisting form I
Hello I'm trying to dynamically generate some inputs for my form, but it's not
I have 3 HTML form inputs fields that is dynamically generated by a add
I'm working with a GUI in PowerShell and trying to make the form such
I have an application whereby I dynamically create controls on a form from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.