arrange windows in MDI application

Posted on 2005-04-20
Last Modified: 2008-01-16
Hi easy question here,

I have an MDI application. When i click on a button i want to arrange the mdi children.

my eventhandler looks like this

private void menuItem21_Click(object sender,    System.EventArgs e)

but it doesn't work!!
Question by:therealdreamer81
    LVL 52

    Accepted Solution

    It possibly is working, it just may not be doing what you're expecting.

    ArrangeIcons simply arranges any minimized child forms in the bottom left corner of the MDI window.
    LVL 52

    Expert Comment

    by:Carl Tawn
    As a sample, try this:

       Create a new project with two forms one called Form1 (the MDI form) and one called Form2 (the child form). Then add the following code to it:

                private void Form1_Load(object sender, System.EventArgs e)
                      Form2 newFrm = new Form2();
                      newFrm.MdiParent = this;

                      Form2 newFrm2 = new Form2();
                      newFrm2.MdiParent = this;

                      System.Timers.Timer tmr = new System.Timers.Timer();
                      tmr.Elapsed += new System.Timers.ElapsedEventHandler(TimerEvent);
                      tmr.Interval = 5000;

                public void TimerEvent(object sender, System.Timers.ElapsedEventArgs e)

    When the app starts, minimize both of the child windows and move them away from the bottom corner. When the timer fires you will see the effect of the ArrangeIcons option.

    Hope this helps.
    LVL 1

    Author Comment

    i thought arrange would align the windows next to each other.

    doh doh doh.. !

    it works now though, with cascade and tile horizontal etc.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    745 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

    13 Experts available now in Live!

    Get 1:1 Help Now