Link to home
Start Free TrialLog in
Avatar of velenikolovski
velenikolovski

asked on

TMainMenu - how to make some of the menu items bold?

i have a mainmenu on the form and i want to make some of the menuitems appear in bold.
anyone knows how can i do that?

thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of sas13
sas13
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BedouinDN
BedouinDN

Delphi.About.com has a good article about owner drawing menus located: http://delphi.about.com/od/vclusing/l/aa100300a.htm
hello velenikolovski
if you need make sub item in menuitems on runtime try this

procedure TForm1.Button1Click(Sender: TObject);
 var i,j :integer;
  Item: TMenuItem;
begin
  for I:=0 to MainMenu1.Items.Count-1 do
      begin
       //  MainMenu1.Items[I].Clear;
         Item := MainMenu1.Items[I];
            item := TMenuItem.create(mainmenu1);
            item.caption := inttostr(i) ;
            item.OnClick := MenuClick ;
           IF i=2 Then
              Item.Enabled:= False ;

            mainmenu1.items[I].add(item);
         End;

      end;

procedure TForm1.MenuClick(Sender: TObject);
var MI : TMenuItem;
     MCap:string;
begin
  MI := TMenuItem(Sender);
  MCap:= MI.Caption ;
    if MCap='&0' Then ShowMessage(Mcap)
    else ShowMessage('do samething');

end;