When the program went to the CSDN forum at night, I saw a friend in C # who asked "Prevent MDI child forms from being instantiated multiple times", and I wrote this article immediately.
In fact, this problem is the classic 23 design patterns in the single piece mode (Singleton), following the implementation of C #:
First we have 2 Windows Forms, the main form is called Form1, and the subform is called ChildForm. By adding a menu to the main form t
Facebook experienced large-scale downtime on Thursday, with the affected users covering the world. Facebook went down for about 40 minutes. Twitter users complained about Facebook's downtime on the social networking site. When a user logs on to the
Body
Questions raised to customers
What can we do with Moss?
How does your company manage documents now?
Moss provides a complete web-based document management platform and
If the following figure is displayed:
After maximization:
Move to cover the menu bar:
You should know that after C # has maximized the child form, the title bar of the child form will be integrated with the menu bar of the parent form. After the
1. Create the main menu m_main.
2. Create the main Window w_main and set its property Window Type to mdihelp !, Set the MenuName attribute to m_main.
3. Create the w_pic image Window, place the picture control in the Window, and name it p_1; set the
One question the day before yesterday: when the main form is fsmdiform, the form that calls DLL cannot be embedded in the main form. So I found related information on the Internet and found the answer: DLL encapsulation subform.
After
Suppose you need to display tform2 on Panel1 of tform1, the simplest way is to rewrite tform2.
Tform2 = Class (tform)
Private
...
Public
Constructor create (aowner: tcomponent); override;
End;
Implementation
Constructor tform2.create
We will see a very cool JS framework prototype window class on the Internet tonight. With prototype window class, Web developers can easily build a variety of windows on the web page ). In addition, the prototype window class file is complete, so it
Create a Window Form (main Window)Define isMDIContainer attribute to TrueAdd a menu or toolbar to open and close subwindows.Create a new window form (subwindow, for example, Form2)Add the following code to the event that opens a subwindow in the
Child.cs
------------------------------------------------------------
Using system;
Using system.drawing;
Using system.collections;
Using system.componentmodel;
Using system.windows.forms;
Namespace testagain
{
///
///Summary description for child.
Create all kinds of guns.Design Focus:1 base class as interface2 Inheriting classes are a variety of different classes3 Build the factory class, then create different classes as needed, you can pass in keywords, or indexes, and so on.#pragma
Once theMDI child form is enlarged, the subform icon crosses the menu bar and runs to the top. Sets the Mainmenustrip property in the parent window to the menustrip! of the parent windowTwo1. Establish the MainForm (set attribute ismdicontainer=true)
Document directory
Reproduction steps
Error cause
Solution
Reproduction steps
Use vs2010 to create an MFC application project.
In the generate wizard, make the following settings:
Application Type page: Select multiple documents (default)
In fact, this is the singleton mode in the classic 23 design patterns. The following uses C # To implement it:
First, we have two windows forms. The main form is form1 and the child form is childform. Add a menu to the main form to instantiate the
The details are complex. Let's just talk about the details on the boulevard. In retrospect, I can't recall it. Hey!
To implement multiple document types, add the corresponding doctemplate and save the document type with the addtemplate in the
In the cxxxapp: onfileopen () method of the app class, do not call cwinapp: onfileopen. Instead, call your own file selection box to obtain the file path and then call cwinapp: opendocumentfile to open the file.
As follows:
Void cmyprjeditdemoapp:
Spent the morning of my time, looking for to find the answer, but also impatient, had to do their own, laughed, and please give more advice, thank you.
Parent.cs
------------------------------------------------------------
Using System;
Using System.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.