Hi..
Ques : What is a multiple-document interface(MDI) and also explain What is a single-document interface (SDI) ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manish SinghPosted Feb 19, 2012, 6:28 AM
Thanks for help me.
Sam HobbsPosted Feb 19, 2012, 5:04 AM
Note that the first paragraph of that says "[Many new and intermediate users find it difficult to learn to use MDI applications. Therefore, you should consider other models for your user interface. However, you can use MDI for applications which do not easily fit into an existing model.]". The significant part there is that it is saying that MDI is not as easy to use as it seems to beginners. Beginners try to use it because they think it is an easy solution but then they end up spending a lot of time fighting with it to do what they want to do that it was not designed to do.
The next paragraph says that MDI is "for applications that enable the user to work with more than one document".
Sam HobbsPosted Feb 19, 2012, 4:54 AM
I assume that Satyapriya's reply was copied from someplace. I think it was written by someone that is not experienced with the fundamental MDI in the Windows API and is therefore not familiar with the true purpose of MDI. Many developers unfamiliar with MDI think that MDI is for multiple windows, but MDI is the Multiple Documents Interface. It was designed to support multiple documents and one or more windows for each document.
A very typical example of a document is a Word document. Another is an Excel workbook. Another is a table, as in Access. In all of those applications, each document is generally separate from other documents and are in windows separate from other windows for other documents. An Access query can retrieve data from multiple tables but in the case of a query, the query is the document.
Microsoft Office continually changes the way the Office UI works but back in the days that MDI was designed, the Microsoft Office applications used MDI.
.Net does not support all of the features that the Windows API provides. One huge peice that is missing is support for windows within windows; that is, windows that are children of a frame window. The Windows API offers more in that area than what .Net (Windows Forms) provides. Developers try to use MDI to fill in what is missing but MDI is not designed for that.
Since MDI is defined by the Windows API, I am not aware of support for it outside of Windows Forms. There might be other things that are similar but they would not be true MDI. Therefore this question should be in the Windows Forms forum.
Satyapriya NayakPosted Feb 17, 2012, 11:38 PM
Single Document interface
A SDI application is made up of a single window. Even if there are multiple windows in the application, only one window can be active at a time.
Sigle document interfaces are used by application where the interface of the application can remain constant throughout.
MDI (Multiple Document Interface) is a type of GUI (Graphical User Interface), which presents a single parent (container) window for other windows in a specific application. The opposites of MDI are SDI (Single Document Interface) and TDI (Tabbed Document Interface).
The main advantages of MDI are:
* Child windows are easily managed from a single parent (container) form.
* A single menu and toolbar can be shared for other windows.
* The possibility to work with multiple documents in one window of the same application.
* Closing the parent (container) window, the user closes other child windows.
1. Create a standard C# Windows Forms Application:
2. First of all I have to create a container form. The first form that was created by default can become a container just by changing the IsMdiContainer property to True:
3. Now, I will add a new form to the project. It will be a child form. To add a new form, use the Add New Item button on the IDE toolbar (if you use Visual Studio). Select the Add Windows Form... option from the dropdown menu:
4. Now, when a new form is created, I need to call it from the parent form, so I will create a menu on the first form, using the MenuStrip control:
5. To the newly created menu I will add a root element (I will call it "Container") and a child element (called "New Child..."):
6. Now, to open a new child in the parent form, add this code to the "New Child..." menu item:
1 // Declare the child form as a new one.
2 Form2 childForm = new Form2();
3 // Set the main form as a parent form.
4 childForm.MdiParent = this;
5 // Show the child form.
6 childForm.Show();
Now, if you compile the application and click several times on the "New Child..." menu item, you will get new child forms inside the parent form:
7. Now, I will add some additional menu items that will have the functionality needed to arrange the child forms inside the parent form.
Basically, there are four types of arrangement:
* Cascade
* Tile Horizontal
* Tile Vertical
* Arrange Icons
Here goes the code for all the types of arrangements (add this code to the corresponding menu items):
Cascade
1 // Set the layout to cascade.
2 this.LayoutMdi(MdiLayout.Cascade);
Tile Horizontal
1 // Set the layout to tile horizontal.
2 this.LayoutMdi(MdiLayout.TileHorizontal);
Tile Vertical
1 // Set the layout to tile vertical.
2 this.LayoutMdi(MdiLayout.TileVertical);
Arrange Icons
1 // Set the layout to arrange icons.
2 this.LayoutMdi(MdiLayout.ArrangeIcons);
Note: the ArrangeIcons layout is available only for minimized child forms.
8. Now, if the user opens many child forms, it becomes harder to navigate between them, so I will set the MdiWindowListItem of the menu strip to windowToolStripMenuItem, so all opened child windows will be listed in the Window menu:
Thanks