Save and restore C# form size using Windows Registry


The Windows Registry is a hierarchical database that stores configuration settings and options on Microsoft Windows operating systems. It contains settings for low-level operating system components and for applications running on the platform that have opted to use the registry. The kernel, device drivers, services, SAM, user interface and third party applications can all make use of the registry. The registry also provides a means to access counters for profiling system performance.

When first introduced with Windows 3.1, the Windows registry's primary purpose was to store configuration information for COM-based components. With the introduction of Windows 95 and Windows NT, its use was extended to tidy up the profusion of per-program INI files that had previously been used to store configuration settings for Windows programs. It is not a requirement for a Windows application to use the Windows Registry—for example, the .NET Framework applications use XML files for configuration, while portable applications usually keep their configuration data within files in the directory/folder where the application executable resides.
(From Wikipedia)


In this article, I am going to show you how to save Form size in C# ( C sharp ) using a key in the Windows Registry and restore it

To use the windows registry in your application you should include the <using Microsoft.Win32;> Namespace using the code above
 using Microsoft.Win32;  

Enjoy watching



Download