راست چین یا فارسی کردن منوی اصلی در دلفی

Add a TMainMenu component to a form (Form1)

  1. Add several (top level) menu items (with sub items)
  2. Have a menu item named "HelpMenuItem"
  3. Use the code below in the form's OnCreate event.

procedureTForm1.FormCreate(Sender:TObject); var mii:TMenuItemInfo; MainMenu:hMenu; Buffer:array[0..79]ofChar; begin MainMenu:=Self.Menu.Handle;

//GET Help Menu Item Info mii.cbSize:=SizeOf(mii); mii.fMask:=MIIM_TYPE; mii.dwTypeData:=Buffer; mii.cch:=SizeOf(Buffer); GetMenuItemInfo(MainMenu,HelpMenuItem.Command,false,mii);

//SET Help Menu Item Info mii.fType:=mii.fTypeorMFT_RIGHTJUSTIFY; SetMenuItemInfo(MainMenu,HelpMenuItem.Command,false,mii); end;

/ 0 نظر / 51 بازدید