本文整理自网络,侵删。
// 字串转成字型样式Function StringToStyle(s:String):TFontStyles;var ft:TFontStyles;begin if pos('B',s) >0 then ft := ft + [fsBold]; if pos('I',s) >0 then ft := ft + [fsItalic]; if pos('U',s) >0 then ft := ft + [fsUnderline]; if pos('S',s) >0 then ft := ft + [fsStrikeOut]; Result := ft;end; // 字型样式转成文字Function StyleToString(ft:TFontStyles):String;var s:String;begin s:= ''; if fsBold in ft then s := s + 'B'; if fsItalic in ft then s := s + 'I'; if fsUnderline in ft then s := s + 'U'; if fsStrikeOut in ft then s := s + 'S'; Result := s;end
相关阅读 >>
Delphi spcomm 调试串口解决总是在程序断开的时候才发送指令的问题
Delphi if语法,弹出提示框,不等于写法,判断是否为空
Delphi xe datasnap服务器获取客户端ip地址
更多相关阅读请进入《Delphi》频道 >>