title: Delphi change color of main menu
body: <p>I am creating my own OnAdvancedDrawItem to change the color of the MainMenu.  It works well but I get an annoying white line at the bottom.</p>
  
  <p><img src="https://i.stack.imgur.com/Pw7Mt.jpg" alt="line under main menu"></p>
  
  <p>It disappears when running the mouse over the menu but comes back when another application is selected.  How can I get rid of it?  </p>
  
  <p>Here is my basic code for the background coloring.</p>
  
  <pre><code>unit MenMain;
  
  interface
  
  uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, Menus, ImgList, StdCtrls;
  
  type
    TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    File2: TMenuItem;
    Edit1: TMenuItem;
    Window1: TMenuItem;
    procedure Window1AdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState);
  private
  
  public
  
  end;
  
  var
    Form1: TForm1;
  
  implementation
  
  {$R *.dfm}
  
  procedure TForm1.Window1AdvancedDrawItem(Sender: TObject; ACanvas: TCanvas;  ARect: TRect; State: TOwnerDrawState);
  begin
    with TMenuItem(Sender) do
    begin
      with ACanvas do
      begin
        Brush.Color := clMoneyGreen;
        Inc(ARect.Bottom,1);
        FillRect(ARect);
        Font.Color := clBlue;
        DrawText(ACanvas.Handle, PChar(Caption),Length(Caption),ARect,          DT_SINGLELINE or DT_VCENTER);
      end;
    end;
  end;
  
  end.
  </code></pre>