function ColorToStr(mColor: TColor): string;
begin
if not ColorToIdent(mColor, Result) then
Result := '$' + IntToHex(mColor, 8);
end; { ColorToStr }function StrToColorDef(mStr: string; mDefault: TColor): TColor;
begin
if not IdentToColor(mStr, Integer(Result)) then
if not TryStrToInt(mStr, Integer(Result)) then
Result := mDefault;
end; { StrToColorDef }
begin
if not ColorToIdent(mColor, Result) then
Result := '$' + IntToHex(mColor, 8);
end; { ColorToStr }function StrToColorDef(mStr: string; mDefault: TColor): TColor;
begin
if not IdentToColor(mStr, Integer(Result)) then
if not TryStrToInt(mStr, Integer(Result)) then
Result := mDefault;
end; { StrToColorDef }
解决方案 »
- delphi
- 从TFORM继承一定需要DFM文件???
- 急急,,,有关数据查找的问题,高分相谢!!,如果分不够,再开贴,。
- 5个回复以后就不要来了,重复的不算哦:)
- 关于QQ的隐藏的实现讨论
- 关于DBGrid 在 MultiSelect时一次选择全部记录的问题
- 哪位高手告诉我如何做一个delphi数据库应用程序来操作sqlserver2000的数据库?
- 请问哪位做过打印控件的开发?如何写设计文档和如何从头开始做一个打印控?
- 跨进程获取设置了LVS_OWNERDATA 的SYSLISTVIEW32控件中的数据
- 如何獲取外部程序畫面上Label的Caption值
- :O 作GIS的朋友,让我们一直UP下去直到开GIS版。
- 兄弟们,请大家帮我看一段代码,70分送上。
function GetEnumName(TypeInfo: PTypeInfo; Value: Integer): string;
另TColor是一子届类型,用GetEnumName不行
如果为枚举类型可以这样如TBorderStyle
ShowMessage(GetEnumName(TypeInfo(TBorderStyle), Integer(bsNone)));