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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:29:50+00:00 2026-06-02T16:29:50+00:00

How can I close an opened window when I call a new window? That

  • 0

How can I close an opened window when I call a new window? That means I want only 1 child window at the time. I don’t allow multi-window.

public partial class Main_Usr : Form
    {
        public Main_Usr()
        {
            InitializeComponent();
            this.IsMdiContainer = true;

            if (Program.IsFA) barSubItem_Ordre.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;

            Ordre_Liste f = new Ordre_Liste();
            f.MdiParent = this;
            f.Show();
   }

        private void barButtonItem_CreateOrdre_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Program.AllerRetour = "Ordre Aller";
            Ordre_Fiche f = new Ordre_Fiche();
            f.MdiParent = this;
            f.Show();
        }

        private void barButtonItem_OrdreListe_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Ordre_Liste f = new Ordre_Liste();
            f.MdiParent = this;
            f.Show();
        }

        private void barButtonItem_CreateOrdRet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Program.AllerRetour = "Ordre Retour";
            Ordre_Fiche f = new Ordre_Fiche();
            f.MdiParent = this;
            f.Show();
        }
    }
  • 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-02T16:29:53+00:00Added an answer on June 2, 2026 at 4:29 pm

    There are different ways to implement pseudo masterpage:

    • You can create BaseForm form with desired layout. Then inherit other forms from this BaseForm and provide custom content.
    • You can create MainForm form with desired layout. Then create content controls as UserControls and show them in panel.
    • You can create MasterUserControl with desired layout. Then create content controls by inheriting from MasterUserControl (they will have same layout). Then use your main form as browser for displaying different content controls like pages.

    EXAMPLE:

    1. Create desired layout on Main_Usr form.
    2. Do not set it as MdiContainer
    3. If you want to access some controls (e.g. footer or header from child forms, set property Modifiers of those controls to protected)
    4. Open Ordre_Liste form code and change it to inherit from Main_Usr form, instead of Form
    5. Add custom content to Ordre_Liste form

    voila! you have ‘masterpage’

    UPDATE (for 3rd option)

    1. Create new user control with name MasterUserControl
    2. Create desired layout on this control, keeping space for custom content (btw don’t use TableLayoutPanels – they have issue with designer inheritance).
    3. Create new user control with name HomeUserControl and change it to inherit from your MasterUserControl.
    4. Open HomeUserControl designer and add custom content. Also you can modify parent controls, which has protected modifier.
    5. On your main form place HomePageUserControl

    There different ways to implement navigation between controls (aka pages). Simplest way – have menu on main form. Other way – define event ‘Navigate’ on master control, subscribe to that event on main form, and raise it from ‘pages’.

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

Sidebar

Related Questions

I have a multi Window (A,B,C) application. User can close Window A(transparent and buttonless)
I want to execute a function when an opened child window is closed. Child
How can I programmatically close a window in cocoa mac ? I have opened
Can anyone tell me how I close an opened SQL connection inside a Function?
how can I make this jquery script close all previously opened children when entering
I've an application that you can show and close several Dialogs with: showDialog(...) removeDialog(...)
I do get that we easily can set the Close button text to a
My app opens a browser activity via startActivity(). Can I close that browser activity
I have an application, in that I want to close the entire browser on
I am using below mentioned script to get href of new opened window, but

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.