Created
October 8, 2015 17:13
-
-
Save SajjadArifGul/ebeddb5cc0ca8b30414e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Form1_FormClosing(object sender, FormClosingEventArgs e) | |
{ | |
//initializing width, height, | |
int width, height; | |
//setting values to form's current width & height. | |
width = this.Width; | |
height = this.Height; | |
//accessing & modifying registery at SOFTWARE | |
//if registry exists it will modify it, if doesn't exist | |
//then it will be created thats why w are using 'true' statement. | |
RegistryKey software = Registry.LocalMachine.OpenSubKey("SOFTWARE", true); | |
//creating & modifying subregistery at RegDotNet of SOFTWARE | |
RegistryKey RegEx = software.CreateSubKey("RegDotNet"); | |
//creating & modifying subregistery at Size of RegDotNet | |
RegistryKey SizeKey = RegEx.CreateSubKey("Size"); | |
//storing values of width & height into Registry. | |
SizeKey.SetValue("width",width.ToString()); | |
SizeKey.SetValue("height", height.ToString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment