Solved

Showing MDI Application like SDI

Posted on 2003-10-27
7
234 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Arduino EDI - Programming Language - Voice Recorder 4 105
Bot application - advice 3 63
collection output issue 9 66
Error building VS2105 solution from repository 1 38
In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 …

726 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