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 8047953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:16:35+00:00 2026-06-05T06:16:35+00:00

I am creating a utility that needs to be flexible enough to use different

  • 0

I am creating a utility that needs to be flexible enough to use different types of data input by the user. Not just different data, as one user may enter “Rory Gallagher” another “Merle Travis” another “Louis Jordan” and yet another “Gatemouth Brown.”

More like one user would enter “Rory Gallagher” another “42” and another both a date (such as 9/8/1956) and an ID value (such as “00034872184”).

So the problem is with the GUI: how can I “swap out” the section of the form that prompts them for their input? It seems overkill to create several utilities that are 99% the same. But some “versions” of the app will just need a single “enter some value” label along with a TextBox, while another may need to prompt them for two or even more pieces of information.

I don’t want to have an “Input Data” button on the form that would invoke another form, because when the user only needs to enter one single bit of information, that would seem quite bizarre.

I’m thinking the Strategy pattern may be in my future here, but the GUI part is still the conundrum. It would be easier if we were using WPF, but we’re not. I guess I could still have a section of the form that I leave large enough to incorporate the “largest” scenario, but is that the best way to go?

UPDATE

I tried the suggestion below:

I added a panel to my form and created a user control via Add | UserControl and tried this:

panel1.Controls.Add(UserControl1);
UserControl1.Dock = DockStyle.Fill; 

…but suffered an epic fail (“‘PlatypiRUs.UserControl1’ is a ‘type’ but is used like a ‘variable'” and “An object reference is required for the non-static field, method, or property ‘System.Windows.Forms.Control.Dock.get'”)

UPDATED AGAIN

Epic success now with this:

UserControl1 usr1 = new UserControl1();
panel1.Controls.Add(usr1);
usr1.Dock = DockStyle.Fill;
  • 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-06-05T06:16:36+00:00Added an answer on June 5, 2026 at 6:16 am

    I would suggest dynamically loading a different user control onto that section of the form. For design-time simplicity, you could put a panel where the dynamic control will be, and then just load it into that panel with docking turned on so it fills the whole panel. Then you can just create a separate user control for each set of data entry fields you need. For instance, if you had a panel control called pnlCustom, you could do the following in the form’s load event (or wherever makes sense):

    UserControl1 customControl = new UserControl1();
    pnlCustom.Controls.Add(customControl);
    customControl.Dock = DockStyle.Fill;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a utility that will store data on flat file in a
I am creating a quick'n'dirty utility that will enable editing of data read sequentially
I need some test data for a MySQL utility that I am creating. Does
I am creating a verification utility that check various parts of an application to
Anyone know of a command line utility (or one that can run as a
I'm creating a utility class that will make it easier for people to parse
I am creating a utility that reads the source lines of VB .NET executables
Creating a patch utility that will update my current website with my patch. when
I'm creating a category over NSDate. It has some utility methods, that shouldn't be
I am creating a game that needs to be integrated with Facebook. The game

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.