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;
【參考連結】
- case 判斷string的方法 | 三窟
Delphi menus always seem to revert to the default font (8, Tahoma) problem,Some users abroad have asked about this,but there is no solution。Currently, the temporary workaround I can think of is to set up a function key (which can be used as a hotkey),so that when users encounter a smaller font,,they can manually reset the font size。(During testing, changing the Windows display scaling percentage can make the menu font revert to the default size)






