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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:05:41+00:00 2026-06-03T00:05:41+00:00

I’m developing a user management system, in which I would like to re-use the

  • 0

I’m developing a user management system, in which I would like to re-use the GUI for the Add User form for the Edit User form, which just changing a few functions.

For example, in my Add Users, the User ID is set to the next available ID, and the Username, password, confirm password, and group are left blank. There is an Add User button that performs validation on the above mentioned fields, and the title of the form is “Add User”

All that needs to change for Edit user is to fill in the data from the user being edited (Getting the DataRow from my DataGridView is not a problem) and changing the Add button to an “Edit User” button while still performing the same validation, and changing the title of the form to “Edit User”.

Is such a thing possible? What would this type of use be called so I could google it more efficiently?

  • 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-03T00:05:43+00:00Added an answer on June 3, 2026 at 12:05 am

    This is absolutely possible, and it’s done all the time. When you instantiate your form for add, you’ll typically do something like this:

    using (AddUserForm form = new AddUserForm())
    {
      form.ShowDialog();
    }
    

    And if you want to edit a user:

    using (AddUserForm form = new AddUserForm(user))
    {
      form.ShowDialog();
    }
    

    Notice that you’ll have two constructors for the form. Within the code for the AddUserForm (which you should really call ModifyUserForm, or UserForm), you’ll do an Add() if the user is null, and an Update() if it’s not null.

    Example constructors:

    public AddUserForm()
    {
      this._user = new User();
    }
    
    public AddUserForm(User user)
    {
      this._user = user;
    }
    

    Then save:

    private void SaveUser()
    {
      if (this._userId == 0)
      {
        MyDal.AddUser(this._user);
        return;
      }
    
      MyDal.UpdateUser(this._user);
    }
    

    I did this all without Visual Studio, so I don’t promise it compiles. 🙂

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

Sidebar

Related Questions

I would like to run a str_replace or preg_replace which looks for certain words
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace

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.