unit unit1;
interface
uses
Windows, Messages....
type
TFormName = (Casefm1, Casefm2, Casefm3);
function xxx(): Boolean;
var
StrFormName: String;
CaseFormName: TFormName;
begin
StrFormName := 'Case' + vFormName;
// 將 FormName(物件) 與 TFormName(值) 做區隔。
// (vFormName為帶有各FormName的字串變數)
CaseFormName := TFormName(GetEnumValue(TypeInfo(TFormName), StrFormName));
case CaseFormName of
Casefm1:
begin
..............
end;
Casefm2:
begin
..............
end;
Casefm3:
begin
...............
end;
【参考链接】
- string 的 case 判断方法 | 三窟
The Delphi menu font seems to always revert to the default (8, Tahoma) Issue,Someone abroad asked about it,But there's no solution。For now, the temporary solution I can think of is to set up a function key (Can be set as a hotkey),So that when the user encounters the font becoming small,They can manually reset the font size。(During testing, changing the Windows display scaling percentage can make the menu font revert to the default)






