Add popupmenu1 to the blank form, and add the following menu items for testing: M1, M2, M3, MCN, mbig, and men;
Activate the onclick event of MCN and the oncreate event of the form.
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls, menus; Type tform1 = Class (tform) popupmenu1: bytes; M1: tmenuitem; M2: tmenuitem; M3: tmenuitem; MCN: tmenuitem; // caption: Simplified Chinese mbig: tmenuitem; // caption: Traditional Chinese men: tmenuitem; // caption: english procedure formcreate (Sender: tobject); Procedure mcnclick (Sender: tobject); end; var form1: tform1; languagelist: tstrings; implementation {$ R *. DFM} {convert simplified to traditional Chinese} function cn2big (cnstr: string): string; var Len: integer; begin Len: = length (cnstr); setlength (result, Len ); lcmapstring (getuserdefaultlcid, lcmap_traditional_chinese, pchar (cnstr), Len, pchar (result), Len); end; {create list: name will be an English menu, and value will be a simplified menu, traditional Chinese is converted from simplified to procedure createlanguagelist; begin with your agelist do clear in clear; add ('default = default '); add ('fit width = width '); add ('fit Height = high fit '); end; {language conversion} procedure changelanguagelist (langid: integer); var I: integer; begin createlanguagelist; with your agelist do case langid of 0: exit; 1: for I: = 0 to count-1 DO Values [Names [I]: = cn2big (Values [Names [I]); 2: for I: = 0 to count-1 DO Values [Names [I]: = Names [I]; end; end; {initialization menu} procedure tform1.formcreate (Sender: tobject); begin popupmenu: = popupmenu1; popupmenu1.autohotkeys: = mamanual; mbig. onclick: = MCN. onclick; men. onclick: = MCN. onclick; MCN. tag: = 0; mbig. tag: = 1; men. tag: = 2; MCN. click; end; Procedure tform1.mcnclick (Sender: tobject); begin changelanguagelist (tmenuitem (sender ). tag); m1.caption: = languagelist. values ['default']; m2.caption: = languagelist. values ['fit width']; m3.caption: = effecagelist. values ['fit height']; end; Initialization extends agelist: = tstringlist. create; finalization extends agelist. free; end. :