MDI Help

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

I am trying to create a multi-document/multi-view app in C#. I have done the
MDI, but I don't see how to create multiple views for a document. Can anyone
point me in the right direction.

Thanks,

Phil

Using VS 2005
 
What do you mean by Multiple views for a document

Opening a child window multiple times
or opening a physical document from Disk many times

?
DaveL
 
Each "Document" contains a set of data that I want to the user to be able to
view in several different ways.

They open a "Document" and have a main "Document" window that lists a
variety of "Views" that they can select. Selecting a "View" will open
another child window that has access to the data in the document, but is
represented in a particular way (graph, grid, etc).

Hope this clarifies things.

Thanks,

Phil
 
sounds like theres a menu involved

you could set your menu event to one event somthing like MenuCommand

Something along the lines of below


private void MenuCommand(object sender, EventArgs e)
{
ToolStripMenuItem oMenuItem = (ToolStripMenuItem)sender;
Form oWin=null;
if (oMenuItem.Name == "tsCarol")
{

//kick of a child window
oWin = new ViewGrid();
// if you want ur child window containd with in this window
oWin.MdiParent = this;
}
else if (oMenuItem.Name == "tsBob")
{
//kick of Window of type bob
oWin = new SomeOtherViewType();
oWin.MdiParent=this;
}


if (oWin != null)
{
oWin.Show();
}
// you can also place owin into a ArrayList of objects to manage
open children windows
// and decide to let user open multiple of the same window
// Net has this available, but i forgot where it is....

}
 
Phil said:
I am trying to create a multi-document/multi-view app in C#. I have
done the MDI, but I don't see how to create multiple views for a
document.

I guess you'd need to read up on Model-View-Controller or
Model-View-Presenter patterns. This is quite a big theme, and not
something that could be easily answered in a newsgroup post.

Start here:

http://en.wikipedia.org/wiki/Model-view-controller
http://en.wikipedia.org/wiki/Model_View_Presenter

That should give enough links to those and to their descendant patterns.

--
Rudy Velthuis http://rvelthuis.de

"Humor is the only test of gravity, and gravity of humor; for a
subject which will not bear raillery is suspicious, and a jest
which will not bear serious examination is false wit."
-- Aristotle (384 BC-322 BC)
 

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

Back
Top