首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > WINFORM保存参数至本机注册表

WINFORM保存参数至本机注册表

资 源 简 介

实现在窗体关闭时将窗体中的参数保存变量至注册表,首先创建一个新的子路径,在子路径中创建变量, 如注册表中无此变量将自动创建,若下次有此变量时将更新变量。窗体再次载入时从注册表子路径读取 此变量信息,通过赋值给控件。 方法如下: private void Form1_Load(object sender, EventArgs e) //窗体载入时 { SetStyle(ControlStyles.SupportsTransparentBackColor, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); this.Refresh(); this.ShowInTaskbar = false; this.PAN_1.Visible = false; int Z_alpha,Z_red,Z_green,Z_blue; //声明4个Int类型颜色变量 //this.TransparencyKey = Color.Transparent; RegistryKey myReg1, myReg2, myReg3;//声明注册表对象 myReg1 = Registry.CurrentUser;//获取当前用户注册表项 try

文 件 列 表

test
test
test.sln
test.suo
VIP VIP
0.270271s