How to store a font object??
在程序中,允许用户对一个RichTextBox的字体进行设置.期望这次设置可以被保存起来,下次使用的时候便不需要再次设置.我使用注册表来完成这项工作,但似乎效果不佳:<
我的做法是:在窗体关闭的时候,写注册表:
RegistryKey regkey = Registry.CurrentUser.OpenSubKey(strRoot,true);
if(regkey == null)//the registry key does not exist,so create it
regkey = Registry.CurrentUser.CreateSubKey(strRoot);
RegistryKey rkProfile = regkey.OpenSubKey(strProfile,true);
if(rkProfile == null)//create the registry key
rkProfile = regkey.CreateSubKey(strProfile);
//write
rkProfile.SetValu("RecognitionResultFont",this.richTextBoxOutput.Font);
但是在注册表中保存的乃是:
[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=134, GdiVerticalFont=False]
在重新允许程序的时候,这不能完成从注册表的加载.
各位大侠指点迷津~~
我的做法是:在窗体关闭的时候,写注册表:
RegistryKey regkey = Registry.CurrentUser.OpenSubKey(strRoot,true);
if(regkey == null)//the registry key does not exist,so create it
regkey = Registry.CurrentUser.CreateSubKey(strRoot);
RegistryKey rkProfile = regkey.OpenSubKey(strProfile,true);
if(rkProfile == null)//create the registry key
rkProfile = regkey.CreateSubKey(strProfile);
//write
rkProfile.SetValu("RecognitionResultFont",this.richTextBoxOutput.Font);
但是在注册表中保存的乃是:
[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3, GdiCharSet=134, GdiVerticalFont=False]
在重新允许程序的时候,这不能完成从注册表的加载.
各位大侠指点迷津~~
...全文
相关推荐
JSP Simple Examples
JSP Simple ExamplesIndex 1.Creating a StringIn jsp we create a string as we does in a java. In jsp w
LuaUnicode icu-lua
来源: http://lua-users.org/wiki/LuaUnicode目录:| LuaUnicode.url|+---0.13A| ICU4Lua-0.13A-src.zip
计算机专用英语词汇
- **例句**:“Declare a variable to store the user input.”(声明一个变量以存储用户输入。)73.
Visual C++ 编程资源大全(英文源码 表单)
1,01.zip<br>MFC Extension Library<br>MFC扩展界面库, 使用Visual C++ 6.0(15KB)<END><br>2,02.zip<br>Visual Stu
Microsoft Library MSDN4DOS.zip
MSL 即 Microsoft Library 是 DOS 版的 "WinHelp",也就是现代版 Help Viewer 的始祖。安装目录下有个 ini 文件,用来指定图书的路径,它即是目录。文件来


