C# move form

Posted on 2009-04-16
Last Modified: 2013-11-07
I have to windows forms, form A and form B include in single EXE file. Is it possible to move both two form by clicking on and move one form only. For example click on form A and move, so form B also move
Question by:exprotein
    LVL 6

    Accepted Solution

    Create two forms Form 2 and 3. Form 2 code should be as below. Try it...
    public partial class Form2 : Form
            Form3 frm = new Form3();
            public Form2()
            private void button1_Click(object sender, EventArgs e)
            private void Form2_Move(object sender, EventArgs e)
                frm.Location  = new Point( this.Location.X +10, this.Location.Y+10) ;

    Open in new window

    LVL 16

    Expert Comment

    Yes it is possible.

    Handle the LocationChanged event of the first form.

    In the handler you can set the Location Property of the second form with respect to the first form.

    Author Closing Comment

    It quite simple but correct, thanks :D

    Author Comment

    I wonder is there another ways to do move two forms, such as using window API. How about two form without border and titlebar ?

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    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…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    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…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    754 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

    19 Experts available now in Live!

    Get 1:1 Help Now