//rc 文件: MyMenu1 MENU begin Popup "File" begin MenuItem "&Open" MenuItem "&Save" MenuItem Separator MenuItem "E&xit" end end {严格的头可能是这样写: MyMenu1 MENU PRELOAD DISCARDABLE}
//程序代码:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, StdCtrls;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  hm: HMENU;
begin
  hm := LoadMenu(HInstance, 'MyMenu1');
  SetMenu(Handle, hm);
end;

end.

//效果图:
学习使用资源文件[6] - 菜单资源

相关文章:

  • 2021-10-10
  • 2021-10-15
  • 2022-12-23
  • 2021-05-25
  • 2022-02-25
  • 2021-05-29
  • 2022-12-23
  • 2021-05-17
猜你喜欢
  • 2021-07-19
  • 2021-04-19
  • 2022-02-21
  • 2021-08-20
  • 2021-12-21
相关资源
相似解决方案