Solved

Showing MDI Application like SDI

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
A short article about problems I had with the new location API and permissions in Marshmallow
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

825 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