Solved

Showing MDI Application like SDI

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

862 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

22 Experts available now in Live!

Get 1:1 Help Now