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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:19:59+00:00 2026-06-05T00:19:59+00:00

Basically, this program I want to have a common backend, but have it so

  • 0

Basically, this program I want to have a common backend, but have it so I can compile it with a different GUI to control the program. I know that I can make multiple forms, but is there a way to tell the solution to compile, and say that Form1 is the GUI, and then later, compile it and tell it that Form2 is the GUI (and to not include Form1 in the compiled program).

Form1 will be more for an administrator with more features, while the Form2 will be for a normal user with far less capabilities than the Form1. Is this possible, or do I just have to make a new solution?

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

    Yes, you can use conditional compilation and exclude code from the compile entirely. So you can do something similar to:

    #if USER_GUI
    
    public class BasicForm : Form
    {
      // ...
    }
    
    #endif
    

    and

    #if ADMIN_GUI
    
    public class AdvancedForm : Form
    {
      // ...
    }
    
    #endif
    

    then have a similar #ifdef when starting the GUI to call the approriate constructor

    public static void Main(string[] args)
    {
        // ...
    
        #if USER_GUI
        var form = new UserForm()
        #endif
    
        #if ADMIN_GUI
        var form = new AdvancedForm()
        #endif
    
        Application.Run(form);
    }
    

    When you compile, you can set the project properties with the appropriate variable in Project -> Properties -> Build -> Conditional compilation symbols, and add either USER_GUI or ADMIN_GUI

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

Sidebar

Related Questions

I have this program that I want other processes to be able to call
basically, I have a program that has a class to create a basic GUI,
Here's the thing... I have 2 GUI programs. A Menu Program,which is basically a
I have a QBASIC program that basically consists of formulas and constants, and I
Basically I've written this program to check for strings. I've used socket method for
I am coding a little program and this is basically my first time to
basically this is my question: How to query MongoDB with "like"? but i guess
The criteria is basically this: folders will exist for about 24-48hrs folders names can
The problem is basically this, in python's gobject and gtk bindings. Assume we have
My understanding is that Ladner's theorem is basically this: P != NP implies that

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.