阿宽

Nothing is more powerful than habit!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

C# String轉成FontStyle

Posted on 2008-04-14 16:58  宽田  阅读(1185)  评论(0编辑  收藏  举报

                    //將String轉成FontStyle
                    FontStyle fsStyle = (FontStyle)Enum.Parse(typeof(FontStyle), sContentFontStyle);


sContentFontStyle為FontStyle的string值,多個時以","分隔 。如:
FontStyle fsStyle = (FontStyle)Enum.Parse(typeof(FontStyle), "Bold,Italic,Underline,Strikeout");