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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:17:34+00:00 2026-05-31T05:17:34+00:00

EDIT:: This might be simple for some but right now it has me confused.

  • 0

EDIT::
This might be simple for some but right now it has me confused. I am working on a project and when the submit button is pressed,create either a person or an employee based on the above checkbox. Put all of the form data into the class object using either the constructor or properties. Display all of the class information using the ToString method and a messagebox.

My question is::
When it is asking when the submit button is pressed, create a person or an employee based on the above checkbox.Would I use what is above the checkbox or below.

Also to put all of the form data into the class object using either the constructors or properties. I’m Not to sure how to do this.

Display all of the class information using a ToString and a messagebox. I understand how to do a messagebox but not with a ToString.

Now I already have two classes and those names are Members and Employees. Under the Members I have Name, Age, and COB. Under the employees I have Salary and JobTitle. The only time that the salary and jobtitle comes up if the user check the checkbox that says is person employee.

I am sorry if I confuse people I myself is kinda confused with what is being asked. The software I am using is Microsoft Visual C# 2010 Expressed.

The code I have so far don’t know if it is right or not:

  private void button1_Click(object sender, EventArgs e)
    {
        Members obj = new Members(); <---This is what is I am assuming being asked when
        obj.Name = "";                   its says create either a person or an employee
        obj.Age = "";                    based on the above checkbox.
        obj.COB = "";

        Employess obj1 = new Employess(); <-- here I am trying to put all of the form 
        obj1.Salary = "";                     data into the class object using either
        obj1.JobTitle = "";                   the constructor or properties.




        Console.WriteLine(obj.ToString());<--- this is the messagebox I am being asked to do its not all the way done.


    }
  • 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-31T05:17:35+00:00Added an answer on May 31, 2026 at 5:17 am

    From what I get from your code is you have taken two classes for employees and members and you want to store their information in objects of respective classes based upon your checkbox selection. I suppose you are working in windows forms because you have specified the button_click event.
    If that’s the case:

    private void button1_Click(object sender, EventArgs e)
    {
        if(checkbox1_Member.Checked==true)
        {
                  Members obj = new Members();
                  obj.Name = "";
                  obj.Age = "";
                  obj.COB = "";
                  MessageBox.Show(obj.Name+ " :: " +"obj.Age.ToString());
        }
        else if(checkbox2_Employee.Checked==true)
        {
                  Employees obj1 = new Employees();
                  obj1.Salary = "";
                  obj1.JobTitle = "";             
                  MessageBox.Show (obj1.Salary.ToString()+ " ::"+obj.JobTitle.ToString());
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey there! I'm doing this project and right now I'm trying to: create some
This might be a simple question, but am trying to access a button inside
The title of this question might be confusing but the problem is simple. I'm
This might be a really simple thing but i was unable to find an
I have a pretty simple problem, but right now can't seem to see the
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
(EDIT: This question is now outdated for my particular issue, as Google Code supports
Edit: This is not a conflict on the theoretical level but a conflict on
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
I know this might sound silly but I have no idea how to do

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.