Solved

Showing MDI Application like SDI

Posted on 2003-10-27
7
231 Views
Last Modified: 2010-05-18
Hi,

I am trying to develop an MDI Application in C# Which should appear like SDI. To achieve this, We have created a parent form, and make all other forms MDI children.


We keep one children active in parent form. All the navigation is controlled from tollbar, menubar present on parent. We open child form in maximized state and its Control box, ShowInTaskBar properties are also set to false. But still it shows child form's top bar on some forms, while all other forms behave nicely.








0
Comment
Question by:Yassar
  • 3
7 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9631904
For that you have to remove the close button of ChildFrame and maximize the child window when it activates...

This will do both


Override PreCreateWindow, ActivateFrame of CChildFrame and do the follwoing


BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
      // TODO: Modify the Window class or styles here by modifying
      //  the CREATESTRUCT cs

      cs.style &= ~WS_SYSMENU;
      if( !CMDIChildWnd::PreCreateWindow(cs) )
            return FALSE;

      return TRUE;
}


void CChildFrame::ActivateFrame(int nCmdShow)
{
      if (nCmdShow == -1)
        nCmdShow = SW_SHOWMAXIMIZED;
            
      CMDIChildWnd::ActivateFrame(nCmdShow);
}

Good Luck
0
 

Author Comment

by:Yassar
ID: 9631937
Thanks for tip, But how to achieve it in C#
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9631954
Ooops, I donno C# :o(
Rosh
0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 250 total points
ID: 9631971
http://www.codeproject.com/csharp/sdimdiwizards.asp - C# SDI/MDI Application wizards
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now