Saving Window Position

Posted on 2006-05-03
Last Modified: 2012-06-21

I'm a newbie to Visual  I just wanted to know if C# had some built in functionallity to save window postion, size, ect... or do I need to create and save this info to an ini file like the old days.  if so, can someone show me some methods.

Question by:fibdev
    LVL 55

    Accepted Solution

    There is not an explicit functionality, but usually is saved in registry or some xml file. Some examples.

    Expert Comment

    you can do it by using inbuilt functionality  for form
    go to Windows Form Designer generated code

    you can select size and lot of other options

                            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
                      this.ClientSize = new System.Drawing.Size(616, 437);
                      this.MaximizeBox = false;
                      this.Name = "Form1";
                      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;

    hope this helps
    LVL 3

    Author Comment

    I ended up writing my own class because I wanted to save the data to an xml file in the application directory.  I wasn't happy with the way these handled it, but thanks for getting my mind going in the direction it needed to.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    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

    18 Experts available now in Live!

    Get 1:1 Help Now