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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:18:22+00:00 2026-05-12T06:18:22+00:00

This is my scenario… I have a winForm tabControl that has a variety of

  • 0

This is my scenario…
I have a winForm tabControl that has a variety of fields on each tab (each tab has different fields). When the user clicks the ‘Generate’ button it is then supposed to pass controls from the tabControl’s tab so that the called function can create an e-mail based off of the passed control’s information. Each tab is a different e-mail template. The method can be called from 4 different buttons, each button being on a different tabControl page and each tabControl having different fields.

The problem I am having is that I cannot figure out a decent way to call/pass these controls. Since it is not known what tabControl button is being pressed until after runtime I am trying to create an abstract method to accept these controls because each tab has a different set of controls.

Any ideas?

  • 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-12T06:18:22+00:00Added an answer on May 12, 2026 at 6:18 am

    As someone else mentioned, you can cheat and try using

    tabControl.Controls
    

    for a quick and dirty fix.

    If you want something that will be workable going forward, as well as expose you to some better design practices, I’d suggest an alternative. Create an EmailUserControl UserControl that holds all those form’s fields for the email. Place that user control on the tab instead of all the individual fields. Then provide a method on the user control that generates the desired email with all the fields taken into account, and then you can pass your actual email about instead of all the individual pieces and parts that you can use to create it.

    There are additional improvements available on that design, of course, but this is a great opportunity for you to get your feet wet and try something a little bit better. As you get more comfortable with the idea of UserControls, you’ll recognize additional opportunities for improving your controls’ design yourself. 🙂

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

Sidebar

Related Questions

Imagine this scenario: I have a link that fires up a JavaScript function(has an
Consider this scenario. I have my own website, that I use as my identifier,
Imagine this scenario: You have a desktop and a laptop. The desktop has a
Consider this scenario. I have some business logic that now and then will be
i need to implement this scenario Brief about that is have two java based
In this scenario I have an app in which: The user is to log
I have this scenario in my 3-tier app with a Service Layer that serves
Imagine this scenario: you have a WCF web service that gets hit up to
In this scenario: User enters some information into a textbox User clicks a button
[This scenario is for illustration] I have certain products, and each product can have

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.