How to Duplicate MS-Word MDI Behavior?

D

David Palau

I have an application in which I would like emulate the MDI behavior as
seen in some of the Microsoft Office applications, particularly Word.

However I can't seem to figure out how to do this with the traditional
MDI development in .NET.

I would like to have the following behavior as shown in Word 2000 for
example:

1. Each MDI child is it's own complete window that shows in the task
bar.

2. Merged menus and toolbars aren't needed (as shown in Word when no MDI
child is loaded, all the menu/toolbar items stick around and just become
disabled.

3. The list of MDI children appears in a Window list (however for my app
I don't need to do any Arranging or Splitting).

4. When only one document is opened in Word, a Close Window button (a
"X") appears on the right-hand side of the main menu bar. As soon as
more than one document is opened, this System-like button disappears.
There is no way to maximize or minimize the document within the
'parent'.


I have been able to programmatically duplicate the first three above by
just using regular Windows Forms and having the 'child' be made up of
User Controls and Panels that appear in the 'parent' form. And then
behind the scenes I have an 'organizer' object that manages the Windows
and things common between them.

But item #4 eludes me. Is this possible? Trying to have an 'always
maximized' MDI child within each main window doesn't work as the system
buttons will always appear no matter what (and will even allow you to
Restore to a non-maximized state).

Do I have to somehow be able to fake it by having a regular button on
the main menu to act like a System Close button?


Thanks in advance for any pointers,

-David
 
H

Herfried K. Wagner

Hello,

David Palau said:
I have an application in which I would like emulate the
MDI behavior as seen in some of the Microsoft Office
applications, particularly Word.

IMO Word's MDI behavior whould win the worst GUI concept award.

Developing an application that works similar to the Word windows is
hard, because you may have to set up taskbar proxies. I would use the
next generation: Tabs...

http://www.dotnetmagic.com/

Regards,
Herfried K. Wagner
 
D

David Palau

1. Each MDI child is it's own complete window that shows in the task
This could be done by using multiple instances of a single SDI app.

I actually use multiple windows with an application 'manager' being
the 'main' app.
Not sure what you are describing at here. sorry.

For most traditional MDI apps, when there is no 'document' in the MDI
parent, several menu/toolbar items disappear. In Word 2000 though
these items don't disappear, they simply become disabled. Sorry,
didn't explain that one clearly.

This could be done with an SDI app too. There are a number of different
ways you could implent this - using shared members of a class, using
remoting, registry, etc... Just need to have each instance register, and
un-register it's self with a common source.

I am just using a custom collection and have the application manager
post events that the other main windows catch when the status of the
Windows list changes.
Just add the X button manually and make sure it is on top of your tool bar
(not contained by it however).

I was going to try this but I just couldn't get the exact look I
wanted.

Again, it's not an MDI window, it's just using MDI logic. (IMO)

Also keep in mind that you might be able to find a full description of how
to accomplish this interface on MSDN, however, MS spend a _LOT_ of money on
the Office interface, and to date, they haven't exactly been forth-coming
with the blueprints of how everything was designed. So maybe a few hacks and
some duct tape isn't so bad...

I know, it is rather odd. And if you look at Word XP or Excel 2000
there is the added wrinkle of having an option to either have each
instance of a document appear in the task bar or not, in which case it
is does actually act like a 'traditional' MDI.

Actually the 3rd party tool set we are using (www.syncfusion.com)
solves this issue because their MDI children will not show the system
buttons when maximized supposedly (in an upcoming patch they tell me).

Thanks for the reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top