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

  • Home
  • SEARCH
  • 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 3486638
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:03:16+00:00 2026-05-18T11:03:16+00:00

I am working on a Windows Form Application and I want to allow the

  • 0

I am working on a Windows Form Application and I want to allow the user to add groups of (2) data inputs – whether that is 2 textboxes or some other control. For each “set” they would be inputting text into each field. I would then iterate through each ‘set’ to a dictionary where one goes in as the key and the other the value. It will start with a default of 2 sets of inputs.

So my problem/question is:

1) Since I want to allow them to add a limit number of inputs (but unknown how many they will add), what would be the best control for doing this.

2) how do I group each 2 inputs together so I can add one field as the key and one as the value in a dictionary.

Any thoughts.

  • 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-18T11:03:17+00:00Added an answer on May 18, 2026 at 11:03 am

    I would create a user control, put the two textboxes on it, with the designer names of KeyTextBox and ValueTextBox, then on the user control class, add two properties, one for the key and the other for the value.

    Now let’s say you have a “add text input Pair” button on your main form, and also an empty panel that will hold your list of buttons. In the code for that button you just new up an instance of your KeyValuePairTextBoxControl, then add it to the Panel’s Controls collection.

    Now whenever you want to create a dictionary based on these values you simply loop through the controls collection of that panel, and for each KeyValuePairTextBoxControl you can access it’s key and value properties to place them in the dictionary.

    You could also expose the text changed events of the textboxes through your user control and as you create each control you wire up some handler for these events so that you can refresh your dictionary each time.

    You might be able to do this much cleaner with some data binding features, but generally that can get much more complicated depending on the details of what you want to do.

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

Sidebar

Related Questions

I am working on a windows form application. How do i use the find
Occasionally working in Windows Vista the O.S. will desaturate the screen, rendering all colors
i'm working on windows mobile app (c#, .net 2.0). i would like to make
I am working on Windows Server 2003 (IIS6), which has two asp.net sites running
I have an Open Source app and I have it working on Windows, Linux
Where can I find the option to switch between the Windows Working Set in
Has anyone managed to get subsonic or a variant working on Windows Mobile? We
Ok, this is working on windows. My Java app is running and functioning normally
I'm attempting to get my first ASP.NET web page working on windows using Mono
While working between a Windows MySQL server and a Debian MySQL server, I noticed

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.